mirror of https://gitlab.com/bashrc2/epicyon
Translations for website profile field
parent
39ab8ecd53
commit
5a68eece77
10
daemon.py
10
daemon.py
|
@ -4837,15 +4837,17 @@ class PubServer(BaseHTTPRequestHandler):
|
|||
actorChanged = True
|
||||
|
||||
# change website
|
||||
currentWebsite = getWebsite(actorJson)
|
||||
currentWebsite = getWebsite(actorJson,
|
||||
self.server.translate)
|
||||
if fields.get('websiteUrl'):
|
||||
if fields['websiteUrl'] != currentWebsite:
|
||||
setWebsite(actorJson,
|
||||
fields['websiteUrl'])
|
||||
fields['websiteUrl'],
|
||||
self.server.translate)
|
||||
actorChanged = True
|
||||
else:
|
||||
if currentWebsite:
|
||||
setWebsite(actorJson, '')
|
||||
setWebsite(actorJson, '', self.server.translate)
|
||||
actorChanged = True
|
||||
|
||||
# account moved to new address
|
||||
|
@ -6184,7 +6186,7 @@ class PubServer(BaseHTTPRequestHandler):
|
|||
movedTo = actorJson['movedTo']
|
||||
lockedAccount = getLockedAccount(actorJson)
|
||||
donateUrl = getDonationUrl(actorJson)
|
||||
websiteUrl = getWebsite(actorJson)
|
||||
websiteUrl = getWebsite(actorJson, self.server.translate)
|
||||
xmppAddress = getXmppAddress(actorJson)
|
||||
matrixAddress = getMatrixAddress(actorJson)
|
||||
ssbAddress = getSSBAddress(actorJson)
|
||||
|
|
12
donate.py
12
donate.py
|
@ -8,14 +8,14 @@ __status__ = "Production"
|
|||
__module_group__ = "Profile Metadata"
|
||||
|
||||
|
||||
def _getDonationTypes() -> str:
|
||||
def _getDonationTypes() -> []:
|
||||
return ('patreon', 'paypal', 'gofundme', 'liberapay',
|
||||
'kickstarter', 'indiegogo', 'crowdsupply',
|
||||
'subscribestar')
|
||||
|
||||
|
||||
def _getWebsiteStrings() -> str:
|
||||
return ('www', 'website', 'web', 'homepage')
|
||||
def _getWebsiteStrings() -> []:
|
||||
return ['www', 'website', 'web', 'homepage']
|
||||
|
||||
|
||||
def getDonationUrl(actorJson: {}) -> str:
|
||||
|
@ -43,12 +43,13 @@ def getDonationUrl(actorJson: {}) -> str:
|
|||
return ''
|
||||
|
||||
|
||||
def getWebsite(actorJson: {}) -> str:
|
||||
def getWebsite(actorJson: {}, translate: {}) -> str:
|
||||
"""Returns a web address link
|
||||
"""
|
||||
if not actorJson.get('attachment'):
|
||||
return ''
|
||||
matchStrings = _getWebsiteStrings()
|
||||
matchStrings.append(translate['Website'])
|
||||
for propertyValue in actorJson['attachment']:
|
||||
if not propertyValue.get('name'):
|
||||
continue
|
||||
|
@ -129,7 +130,7 @@ def setDonationUrl(actorJson: {}, donateUrl: str) -> None:
|
|||
actorJson['attachment'].append(newDonate)
|
||||
|
||||
|
||||
def setWebsite(actorJson: {}, websiteUrl: str) -> None:
|
||||
def setWebsite(actorJson: {}, websiteUrl: str, translate: {}) -> None:
|
||||
"""Sets a web address
|
||||
"""
|
||||
notUrl = False
|
||||
|
@ -146,6 +147,7 @@ def setWebsite(actorJson: {}, websiteUrl: str) -> None:
|
|||
actorJson['attachment'] = []
|
||||
|
||||
matchStrings = _getWebsiteStrings()
|
||||
matchStrings.append(translate['Website'])
|
||||
|
||||
# remove any existing value
|
||||
propertyFound = None
|
||||
|
|
|
@ -472,5 +472,6 @@
|
|||
"City or location of the wanted item": "مدينة أو موقع العنصر المطلوب",
|
||||
"Maximum Price": "السعر الأقصى",
|
||||
"Create a new wanted item": "قم بإنشاء عنصر مطلوب جديد",
|
||||
"Wanted Items Search": "البحث عن العناصر المطلوبة"
|
||||
"Wanted Items Search": "البحث عن العناصر المطلوبة",
|
||||
"Website": "موقع إلكتروني"
|
||||
}
|
||||
|
|
|
@ -472,5 +472,6 @@
|
|||
"City or location of the wanted item": "Ciutat o ubicació de l’article desitjat",
|
||||
"Maximum Price": "Preu màxim",
|
||||
"Create a new wanted item": "Creeu un element desitjat",
|
||||
"Wanted Items Search": "Cerca d'articles desitjats"
|
||||
"Wanted Items Search": "Cerca d'articles desitjats",
|
||||
"Website": "Lloc web"
|
||||
}
|
||||
|
|
|
@ -472,5 +472,6 @@
|
|||
"City or location of the wanted item": "Dinas neu leoliad yr eitem sydd ei eisiau",
|
||||
"Maximum Price": "Uchafswm Pris",
|
||||
"Create a new wanted item": "Creu eitem newydd ei heisiau",
|
||||
"Wanted Items Search": "Chwilio Eitemau Eisiau"
|
||||
"Wanted Items Search": "Chwilio Eitemau Eisiau",
|
||||
"Website": "Gwefan"
|
||||
}
|
||||
|
|
|
@ -472,5 +472,6 @@
|
|||
"City or location of the wanted item": "Stadt oder Ort des gesuchten Artikels",
|
||||
"Maximum Price": "Höchstpreis",
|
||||
"Create a new wanted item": "Erstelle einen neuen gesuchten Artikel",
|
||||
"Wanted Items Search": "Gesuchte Artikel suchen"
|
||||
"Wanted Items Search": "Gesuchte Artikel suchen",
|
||||
"Website": "Webseite"
|
||||
}
|
||||
|
|
|
@ -472,5 +472,6 @@
|
|||
"City or location of the wanted item": "City or location of the wanted item",
|
||||
"Maximum Price": "Maximum Price",
|
||||
"Create a new wanted item": "Create a new wanted item",
|
||||
"Wanted Items Search": "Wanted Items Search"
|
||||
"Wanted Items Search": "Wanted Items Search",
|
||||
"Website": "Website"
|
||||
}
|
||||
|
|
|
@ -472,5 +472,6 @@
|
|||
"City or location of the wanted item": "Ciudad o ubicación del artículo buscado",
|
||||
"Maximum Price": "Precio Máximo",
|
||||
"Create a new wanted item": "Crea un nuevo artículo buscado",
|
||||
"Wanted Items Search": "Búsqueda de artículos deseados"
|
||||
"Wanted Items Search": "Búsqueda de artículos deseados",
|
||||
"Website": "Sitio web"
|
||||
}
|
||||
|
|
|
@ -472,5 +472,6 @@
|
|||
"City or location of the wanted item": "Ville ou lieu de l'article recherché",
|
||||
"Maximum Price": "Prix maximum",
|
||||
"Create a new wanted item": "Créer un nouvel article recherché",
|
||||
"Wanted Items Search": "Recherche d'objets recherchés"
|
||||
"Wanted Items Search": "Recherche d'objets recherchés",
|
||||
"Website": "Site Internet"
|
||||
}
|
||||
|
|
|
@ -472,5 +472,6 @@
|
|||
"City or location of the wanted item": "Cathair nó suíomh an earra a theastaigh",
|
||||
"Maximum Price": "Uasphraghas",
|
||||
"Create a new wanted item": "Cruthaigh mír nua a theastaigh",
|
||||
"Wanted Items Search": "Cuardaigh Míreanna Teastaíonn"
|
||||
"Wanted Items Search": "Cuardaigh Míreanna Teastaíonn",
|
||||
"Website": "Suíomh gréasáin"
|
||||
}
|
||||
|
|
|
@ -472,5 +472,6 @@
|
|||
"City or location of the wanted item": "वांछित वस्तु का शहर या स्थान",
|
||||
"Maximum Price": "अधिकतम मूल्य",
|
||||
"Create a new wanted item": "एक नई वांछित वस्तु बनाएँ",
|
||||
"Wanted Items Search": "वांटेड आइटम सर्च"
|
||||
"Wanted Items Search": "वांटेड आइटम सर्च",
|
||||
"Website": "वेबसाइट"
|
||||
}
|
||||
|
|
|
@ -472,5 +472,6 @@
|
|||
"City or location of the wanted item": "Città o posizione dell'articolo desiderato",
|
||||
"Maximum Price": "Prezzo massimo",
|
||||
"Create a new wanted item": "Crea un nuovo oggetto ricercato",
|
||||
"Wanted Items Search": "Ricerca articoli ricercati"
|
||||
"Wanted Items Search": "Ricerca articoli ricercati",
|
||||
"Website": "Sito web"
|
||||
}
|
||||
|
|
|
@ -472,5 +472,6 @@
|
|||
"City or location of the wanted item": "欲しいアイテムの都市または場所",
|
||||
"Maximum Price": "最高価格",
|
||||
"Create a new wanted item": "新しい欲しいアイテムを作成する",
|
||||
"Wanted Items Search": "欲しいアイテム検索"
|
||||
"Wanted Items Search": "欲しいアイテム検索",
|
||||
"Website": "Webサイト"
|
||||
}
|
||||
|
|
|
@ -472,5 +472,6 @@
|
|||
"City or location of the wanted item": "Bajar an cîhê tiştê xwestî",
|
||||
"Maximum Price": "Maximum Price",
|
||||
"Create a new wanted item": "Tiştek xwestî ya nû biafirînin",
|
||||
"Wanted Items Search": "Wanted Items Search"
|
||||
"Wanted Items Search": "Wanted Items Search",
|
||||
"Website": "Malper"
|
||||
}
|
||||
|
|
|
@ -468,5 +468,6 @@
|
|||
"City or location of the wanted item": "City or location of the wanted item",
|
||||
"Maximum Price": "Maximum Price",
|
||||
"Create a new wanted item": "Create a new wanted item",
|
||||
"Wanted Items Search": "Wanted Items Search"
|
||||
"Wanted Items Search": "Wanted Items Search",
|
||||
"Website": "Website"
|
||||
}
|
||||
|
|
|
@ -472,5 +472,6 @@
|
|||
"City or location of the wanted item": "Cidade ou localização do item desejado",
|
||||
"Maximum Price": "Preço Máximo",
|
||||
"Create a new wanted item": "Crie um novo item desejado",
|
||||
"Wanted Items Search": "Pesquisa de Itens Desejados"
|
||||
"Wanted Items Search": "Pesquisa de Itens Desejados",
|
||||
"Website": "Local na rede Internet"
|
||||
}
|
||||
|
|
|
@ -472,5 +472,6 @@
|
|||
"City or location of the wanted item": "Город или местонахождение разыскиваемого предмета",
|
||||
"Maximum Price": "Максимальная цена",
|
||||
"Create a new wanted item": "Создать новый требуемый предмет",
|
||||
"Wanted Items Search": "Поиск требуемых предметов"
|
||||
"Wanted Items Search": "Поиск требуемых предметов",
|
||||
"Website": "Интернет сайт"
|
||||
}
|
||||
|
|
|
@ -472,5 +472,6 @@
|
|||
"City or location of the wanted item": "Jiji au eneo la kitu kinachotafutwa",
|
||||
"Maximum Price": "Bei ya juu",
|
||||
"Create a new wanted item": "Unda kipengee kipya kinachotafutwa",
|
||||
"Wanted Items Search": "Utafutaji wa Vitu vinavyotafutwa"
|
||||
"Wanted Items Search": "Utafutaji wa Vitu vinavyotafutwa",
|
||||
"Website": "Tovuti"
|
||||
}
|
||||
|
|
|
@ -472,5 +472,6 @@
|
|||
"City or location of the wanted item": "通缉物品的城市或位置",
|
||||
"Maximum Price": "最高价格",
|
||||
"Create a new wanted item": "创建一个新的通缉物品",
|
||||
"Wanted Items Search": "通缉物品搜索"
|
||||
"Wanted Items Search": "通缉物品搜索",
|
||||
"Website": "网站"
|
||||
}
|
||||
|
|
|
@ -548,7 +548,7 @@ def htmlProfile(rssIconAtTop: bool,
|
|||
|
||||
donateSection = ''
|
||||
donateUrl = getDonationUrl(profileJson)
|
||||
websiteUrl = getWebsite(profileJson)
|
||||
websiteUrl = getWebsite(profileJson, translate)
|
||||
PGPpubKey = getPGPpubKey(profileJson)
|
||||
PGPfingerprint = getPGPfingerprint(profileJson)
|
||||
emailAddress = getEmailAddress(profileJson)
|
||||
|
@ -1774,7 +1774,8 @@ def _htmlEditProfileMain(baseDir: str, displayNickname: str, bioStr: str,
|
|||
donateUrl, 'https://...')
|
||||
|
||||
editProfileForm += \
|
||||
editTextField('Website', 'websiteUrl', websiteUrl, 'https://...')
|
||||
editTextField(translate['Website'], 'websiteUrl',
|
||||
websiteUrl, 'https://...')
|
||||
|
||||
editProfileForm += \
|
||||
editTextField('Blog', 'blogAddress', blogAddress, 'https://...')
|
||||
|
@ -1863,7 +1864,7 @@ def htmlEditProfile(cssCache: {}, translate: {}, baseDir: str, path: str,
|
|||
if actorJson.get('movedTo'):
|
||||
movedTo = actorJson['movedTo']
|
||||
donateUrl = getDonationUrl(actorJson)
|
||||
websiteUrl = getWebsite(actorJson)
|
||||
websiteUrl = getWebsite(actorJson, translate)
|
||||
xmppAddress = getXmppAddress(actorJson)
|
||||
matrixAddress = getMatrixAddress(actorJson)
|
||||
ssbAddress = getSSBAddress(actorJson)
|
||||
|
|
Loading…
Reference in New Issue