html: in-dev for translations

This commit is contained in:
Cyrille L 2022-11-23 18:07:44 +01:00
parent c7893a2922
commit f364a1b901
1 changed files with 28 additions and 2 deletions

View File

@ -16,12 +16,38 @@
#----------------------------------------------------------------------
#**********************************************************************
import re
import check, log, domain
trans = [
[ 'Licence', 'License' ], # 0,1
[ 'Générateur', 'Generator' ], # 2,3
]
#=======================================#
# Translations terms #
# Only FR (default) and Other (english) #
#---------------------------------------#
def translations():
global fl # fl = field lang
# Default FR/fr
if re.match('fr', domain.domain_lang, re.IGNORECASE): fl = 0
else : fl = 1
#========================#
# Create FULL HTML5 Page #
# includes wip.html #
#------------------------#
def html_main_page(wip_html):
# Source DB variables
post_db = exec(open(check.curr_post_db).read(),globals())
# Set some terms from lang domain
translations()
# Metas in HTML page
#-------------------
scale = 'width=device-width, initial-scale=1.0'
@ -141,7 +167,7 @@ def html_main_page(wip_html):
domain.domain_title, domain.domain_mail
) + \
' </li>\n' + \
' <li class="site-list">Copyright: \n' + \
' <li class="site-list">%s: \n'%trans[0][fl] + \
' <a id="licurl" href="%s"\n'%domain.domain_lic_url +\
' title="License informations">%s</a>\n'%(
domain.domain_license
@ -151,7 +177,7 @@ def html_main_page(wip_html):
' <a id="site-rss" href="/rss.xml"\n' +\
' title="Syndication %s">/rss.xml</a>\n'%domain.domain_title + \
' </li>\n' + \
' <li class="site-list">Generator: \n' + \
' <li class="site-list">%s: \n'%trans[1][fl] + \
' <a id="tytogen" href="%s"\n'%tytogen +\
' type="application/rss+xml"\n' + \
' title="Website generated by Tyto - Littérateur">Tyto - Littérateur</a>\n' + \