Translate shared items search

master
Bob Mottram 2019-09-07 11:13:12 +01:00
parent 0076870cf7
commit bd0152344c
4 changed files with 12 additions and 7 deletions

View File

@ -2859,7 +2859,8 @@ class PubServer(BaseHTTPRequestHandler):
else: else:
# shared items search # shared items search
sharedItemsStr= \ sharedItemsStr= \
htmlSearchSharedItems(self.server.baseDir, \ htmlSearchSharedItems(self.server.translate, \
self.server.baseDir, \
searchStr,pageNumber, \ searchStr,pageNumber, \
maxPostsInFeed, \ maxPostsInFeed, \
self.server.httpPrefix, \ self.server.httpPrefix, \

View File

@ -129,5 +129,6 @@
"Copy the text then paste it into your post": "Copy the text then paste it into your post", "Copy the text then paste it into your post": "Copy the text then paste it into your post",
"Emoji Search": "Emoji Search", "Emoji Search": "Emoji Search",
"No results": "No results", "No results": "No results",
"Skills search": "Skills search" "Skills search": "Skills search",
"Shared Items Search": "Shared Items Search"
} }

View File

@ -129,5 +129,6 @@
"Copy the text then paste it into your post": "Copiez le texte puis collez-le dans votre message", "Copy the text then paste it into your post": "Copiez le texte puis collez-le dans votre message",
"Emoji Search": "Emoji recherche", "Emoji Search": "Emoji recherche",
"No results": "Aucun résultat", "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"
} }

View File

@ -95,10 +95,12 @@ def htmlSearchEmoji(translate: {},baseDir: str,searchStr: str) -> str:
emojiForm+=htmlFooter() emojiForm+=htmlFooter()
return emojiForm return emojiForm
def htmlSearchSharedItems(baseDir: str,searchStr: str, \ def htmlSearchSharedItems(translate: {}, \
baseDir: str,searchStr: str, \
pageNumber: int, \ pageNumber: int, \
resultsPerPage: int, \ resultsPerPage: int, \
httpPrefix: str,domainFull: str,actor: str) -> str: httpPrefix: str, \
domainFull: str,actor: str) -> str:
"""Search results for shared items """Search results for shared items
""" """
currPage=1 currPage=1
@ -109,7 +111,7 @@ def htmlSearchSharedItems(baseDir: str,searchStr: str, \
with open(baseDir+'/epicyon-profile.css', 'r') as cssFile: with open(baseDir+'/epicyon-profile.css', 'r') as cssFile:
sharedItemsCSS=cssFile.read() sharedItemsCSS=cssFile.read()
sharedItemsForm=htmlHeader(sharedItemsCSS) sharedItemsForm=htmlHeader(sharedItemsCSS)
sharedItemsForm+='<center><h1>Shared Items Search</h1></center>' sharedItemsForm+='<center><h1>'+translate['Shared Items Search']+'</h1></center>'
resultsExist=False resultsExist=False
for subdir, dirs, files in os.walk(baseDir+'/accounts'): for subdir, dirs, files in os.walk(baseDir+'/accounts'):
for handle in dirs: for handle in dirs:
@ -180,7 +182,7 @@ def htmlSearchSharedItems(baseDir: str,searchStr: str, \
break break
ctr=0 ctr=0
if not resultsExist: if not resultsExist:
sharedItemsForm+='<center><h5>No results</h5></center>' sharedItemsForm+='<center><h5>'+translate['No results']+'</h5></center>'
sharedItemsForm+=htmlFooter() sharedItemsForm+=htmlFooter()
return sharedItemsForm return sharedItemsForm