diff --git a/daemon.py b/daemon.py index 537cc644..26854ce7 100644 --- a/daemon.py +++ b/daemon.py @@ -898,7 +898,7 @@ class PubServer(BaseHTTPRequestHandler): if self.path.startswith('/login') or self.path=='/': # request basic auth - msg=htmlLogin(self.server.baseDir).encode('utf-8') + msg=htmlLogin(self.server.translate,self.server.baseDir).encode('utf-8') self._login_headers('text/html',len(msg)) self.wfile.write(msg) self.server.GETbusy=False @@ -1601,7 +1601,8 @@ class PubServer(BaseHTTPRequestHandler): self.server.httpPrefix, \ maxPostsInFeed, 'inbox', \ True,self.server.ocapAlways) - msg=htmlInbox(pageNumber,maxPostsInFeed, \ + msg=htmlInbox(self.server.translate, \ + pageNumber,maxPostsInFeed, \ self.server.session, \ self.server.baseDir, \ self.server.cachedWebfingers, \ @@ -1666,7 +1667,8 @@ class PubServer(BaseHTTPRequestHandler): self.server.httpPrefix, \ maxPostsInFeed, 'dm', \ True,self.server.ocapAlways) - msg=htmlInboxDMs(pageNumber,maxPostsInFeed, \ + msg=htmlInboxDMs(self.server.translate, \ + pageNumber,maxPostsInFeed, \ self.server.session, \ self.server.baseDir, \ self.server.cachedWebfingers, \ @@ -1726,7 +1728,8 @@ class PubServer(BaseHTTPRequestHandler): maxPostsInFeed, 'outbox', \ authorized, \ self.server.ocapAlways) - msg=htmlOutbox(pageNumber,maxPostsInFeed, \ + msg=htmlOutbox(self.server.translate, \ + pageNumber,maxPostsInFeed, \ self.server.session, \ self.server.baseDir, \ self.server.cachedWebfingers, \ @@ -1780,7 +1783,8 @@ class PubServer(BaseHTTPRequestHandler): self.server.httpPrefix, \ maxPostsInFeed, 'moderation', \ True,self.server.ocapAlways) - msg=htmlModeration(pageNumber,maxPostsInFeed, \ + msg=htmlModeration(self.server.translate, \ + pageNumber,maxPostsInFeed, \ self.server.session, \ self.server.baseDir, \ self.server.cachedWebfingers, \ @@ -2656,7 +2660,8 @@ class PubServer(BaseHTTPRequestHandler): moderationText=moderationStr.split('=')[1].strip() moderationText=moderationText.replace('+',' ').replace('%40','@').replace('%3A',':').replace('%23','#').strip() elif moderationStr.startswith('submitInfo'): - msg=htmlModerationInfo(self.server.baseDir).encode('utf-8') + msg=htmlModerationInfo(self.server.translate, \ + self.server.baseDir).encode('utf-8') self._login_headers('text/html',len(msg)) self.wfile.write(msg) self.server.POSTbusy=False diff --git a/translations/en.json b/translations/en.json index c9e1a759..1a1671bb 100644 --- a/translations/en.json +++ b/translations/en.json @@ -90,5 +90,21 @@ "Stop blocking": "Stop blocking", "Enter an emoji name to search for": "Enter an emoji name to search for", "Enter an address, shared item, #hashtag, *skill or :emoji: to search for": "Enter an address, shared item, #hashtag, *skill or :emoji: to search for", - "Go Back": "Go Back" + "Go Back": "Go Back", + "Moderation Information": "Moderation Information", + "Suspended accounts": "Suspended accounts", + "These are currently suspended": "These are currently suspended", + "Blocked accounts and hashtags": "Blocked accounts and hashtags", + "These are globally blocked for all accounts on this instance": "These are globally blocked for all accounts on this instance", + "Any blocks or suspensions made by moderators will be shown here.": "Any blocks or suspensions made by moderators will be shown here.", + "Welcome. Please enter your login details below.": "Welcome. Please enter your login details below.", + "Welcome. Please login or register a new account.": "Welcome. Please login or register a new account.", + "Please enter some credentials": "Please enter some credentials", + "You will become the admin of this site.": "You will become the admin of this site.", + "Terms of Service": "Terms of Service", + "About this Instance": "About this Instance", + "Nickname": "Nickname", + "Enter Nickname": "Enter Nickname", + "Password": "Password", + "Enter Password": "Enter Password" } diff --git a/translations/fr.json b/translations/fr.json index afc28d2b..5c80d8bb 100644 --- a/translations/fr.json +++ b/translations/fr.json @@ -90,5 +90,21 @@ "Stop blocking": "Arrêtez le blocage", "Enter an emoji name to search for": "Entrez un nom emoji à rechercher", "Enter an address, shared item, #hashtag, *skill or :emoji: to search for": "Entrez une adresse, un objet partagé, #hashtag, * skill ou: emoji: à rechercher", - "Go Back": "Retourner" + "Go Back": "Retourner", + "Moderation Information": "Informations de modération", + "Suspended accounts": "Comptes suspendus", + "These are currently suspended": "Ceux-ci sont actuellement suspendus", + "Blocked accounts and hashtags": "Comptes bloqués et hashtags", + "These are globally blocked for all accounts on this instance": "Ceux-ci sont globalement bloqués pour tous les comptes sur cette instance.", + "Any blocks or suspensions made by moderators will be shown here.": "Tous les blocages ou suspensions réalisés par les modérateurs seront affichés ici.", + "Welcome. Please enter your login details below.": "Bienvenue. S'il vous plaît entrer vos informations de connexion ci-dessous.", + "Welcome. Please login or register a new account.": "Bienvenue. Veuillez vous connecter ou créer un nouveau compte.", + "Please enter some credentials": "S'il vous plaît entrer des informations d'identification", + "You will become the admin of this site.": "Vous allez devenir l'administrateur de ce site.", + "Terms of Service": "Conditions d'utilisation", + "About this Instance": "A propos de cette instance", + "Nickname": "Pseudo", + "Enter Nickname": "Entrez le pseudo", + "Password": "Mot de passe", + "Enter Password": "Entrer le mot de passe" } diff --git a/webinterface.py b/webinterface.py index 5d98174b..edb4e39c 100644 --- a/webinterface.py +++ b/webinterface.py @@ -184,13 +184,13 @@ def htmlSearchSharedItems(baseDir: str,searchStr: str, \ sharedItemsForm+=htmlFooter() return sharedItemsForm -def htmlModerationInfo(baseDir: str) -> str: +def htmlModerationInfo(translate: {},baseDir: str) -> str: infoForm='' with open(baseDir+'/epicyon-profile.css', 'r') as cssFile: infoCSS=cssFile.read() infoForm=htmlHeader(infoCSS) - infoForm+='
Any blocks or suspensions made by moderators will be shown here.
'+translate['Any blocks or suspensions made by moderators will be shown here.']+'
Welcome. Please enter your login details below.
' + loginText=''+translate['Welcome. Please enter your login details below.']+'
' else: - loginText='Please enter some credentials
You will become the admin of this site.
' + loginText=''+translate['Please enter some credentials']+'
' + loginText+=''+translate['You will become the admin of this site.']+'
' if os.path.isfile(baseDir+'/accounts/login.txt'): # custom login message with open(baseDir+'/accounts/login.txt', 'r') as file: @@ -570,15 +571,15 @@ def htmlLogin(baseDir: str) -> str: if getConfigParam(baseDir,'registration')=='open': if int(getConfigParam(baseDir,'registrationsRemaining'))>0: if accounts>0: - loginText='Welcome. Please login or register a new account.
' + loginText=''+translate['Welcome. Please login or register a new account.']+'
' registerButtonStr='' - TOSstr='' - TOSstr+='' + TOSstr=''+translate['Terms of Service']+'
' + TOSstr+=''+translate['About this Instance']+'
' loginButtonStr='' if accounts>0: - loginButtonStr='' + loginButtonStr='' loginForm=htmlHeader(loginCSS) loginForm+= \ @@ -589,11 +590,11 @@ def htmlLogin(baseDir: str) -> str: ' ' \ '' \ '