Translate skills search

master
Bob Mottram 2019-09-07 11:08:18 +01:00
parent c1388f7fb9
commit 0076870cf7
4 changed files with 11 additions and 6 deletions

View File

@ -2801,7 +2801,8 @@ class PubServer(BaseHTTPRequestHandler):
# skill search # skill search
searchStr=searchStr.replace('*','').strip() searchStr=searchStr.replace('*','').strip()
skillStr= \ skillStr= \
htmlSkillsSearch(self.server.baseDir,searchStr, \ htmlSkillsSearch(self.server.translate, \
self.server.baseDir,searchStr, \
self.server.instanceOnlySkillsSearch, \ self.server.instanceOnlySkillsSearch, \
64) 64)
if skillStr: if skillStr:

View File

@ -128,5 +128,6 @@
"Skill": "Skill", "Skill": "Skill",
"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"
} }

View File

@ -128,5 +128,6 @@
"Skill": "Compétence", "Skill": "Compétence",
"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"
} }

View File

@ -287,7 +287,9 @@ def htmlHashtagSearch(translate: {}, \
hashtagSearchForm+=htmlFooter() hashtagSearchForm+=htmlFooter()
return hashtagSearchForm return hashtagSearchForm
def htmlSkillsSearch(baseDir: str,skillsearch: str,instanceOnly: bool,postsPerPage: int) -> str: def htmlSkillsSearch(translate: {},baseDir: str, \
skillsearch: str,instanceOnly: bool, \
postsPerPage: int) -> str:
"""Show a page containing search results for a skill """Show a page containing search results for a skill
""" """
if skillsearch.startswith('*'): if skillsearch.startswith('*'):
@ -362,10 +364,10 @@ def htmlSkillsSearch(baseDir: str,skillsearch: str,instanceOnly: bool,postsPerPa
skillSearchCSS = cssFile.read() skillSearchCSS = cssFile.read()
skillSearchForm=htmlHeader(skillSearchCSS) skillSearchForm=htmlHeader(skillSearchCSS)
skillSearchForm+='<center><h1>Skills search: '+skillsearch+'</h1></center>' skillSearchForm+='<center><h1>'+translate['Skills search']+': '+skillsearch+'</h1></center>'
if len(results)==0: if len(results)==0:
skillSearchForm+='<center><h5>No matches</h5></center>' skillSearchForm+='<center><h5>'+translate['No results']+'</h5></center>'
else: else:
skillSearchForm+='<center>' skillSearchForm+='<center>'
ctr=0 ctr=0