From bd0152344c9f2210753b6756f604bd40cc1b0d4d Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sat, 7 Sep 2019 11:13:12 +0100 Subject: [PATCH] Translate shared items search --- daemon.py | 3 ++- translations/en.json | 3 ++- translations/fr.json | 3 ++- webinterface.py | 10 ++++++---- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/daemon.py b/daemon.py index 24f220e26..bc164aad6 100644 --- a/daemon.py +++ b/daemon.py @@ -2859,7 +2859,8 @@ class PubServer(BaseHTTPRequestHandler): else: # shared items search sharedItemsStr= \ - htmlSearchSharedItems(self.server.baseDir, \ + htmlSearchSharedItems(self.server.translate, \ + self.server.baseDir, \ searchStr,pageNumber, \ maxPostsInFeed, \ self.server.httpPrefix, \ diff --git a/translations/en.json b/translations/en.json index 6c9cd9523..c054524ce 100644 --- a/translations/en.json +++ b/translations/en.json @@ -129,5 +129,6 @@ "Copy the text then paste it into your post": "Copy the text then paste it into your post", "Emoji Search": "Emoji Search", "No results": "No results", - "Skills search": "Skills search" + "Skills search": "Skills search", + "Shared Items Search": "Shared Items Search" } diff --git a/translations/fr.json b/translations/fr.json index ed4bfd7fe..c165178d7 100644 --- a/translations/fr.json +++ b/translations/fr.json @@ -129,5 +129,6 @@ "Copy the text then paste it into your post": "Copiez le texte puis collez-le dans votre message", "Emoji Search": "Emoji recherche", "No results": "Aucun résultat", - "Skills search": "Recherche de compétences" + "Skills search": "Recherche de compétences", + "Shared Items Search": "Recherche d'articles partagés" } diff --git a/webinterface.py b/webinterface.py index 23374b6e1..f40488724 100644 --- a/webinterface.py +++ b/webinterface.py @@ -95,10 +95,12 @@ def htmlSearchEmoji(translate: {},baseDir: str,searchStr: str) -> str: emojiForm+=htmlFooter() return emojiForm -def htmlSearchSharedItems(baseDir: str,searchStr: str, \ +def htmlSearchSharedItems(translate: {}, \ + baseDir: str,searchStr: str, \ pageNumber: int, \ resultsPerPage: int, \ - httpPrefix: str,domainFull: str,actor: str) -> str: + httpPrefix: str, \ + domainFull: str,actor: str) -> str: """Search results for shared items """ currPage=1 @@ -109,7 +111,7 @@ def htmlSearchSharedItems(baseDir: str,searchStr: str, \ with open(baseDir+'/epicyon-profile.css', 'r') as cssFile: sharedItemsCSS=cssFile.read() sharedItemsForm=htmlHeader(sharedItemsCSS) - sharedItemsForm+='

Shared Items Search

' + sharedItemsForm+='

'+translate['Shared Items Search']+'

' resultsExist=False for subdir, dirs, files in os.walk(baseDir+'/accounts'): for handle in dirs: @@ -180,7 +182,7 @@ def htmlSearchSharedItems(baseDir: str,searchStr: str, \ break ctr=0 if not resultsExist: - sharedItemsForm+='
No results
' + sharedItemsForm+='
'+translate['No results']+'
' sharedItemsForm+=htmlFooter() return sharedItemsForm