X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=scripts%2Fbuild%2Fwebsite_post.py;h=c31aa06cd9bc10d1c74254dae35e8563bc7c594f;hb=912d8cf5e3c04f89af05c71441760a9b864e5924;hp=6ad2d5995e92edaa992ba3a5bc7f58cd6acb383f;hpb=6353f0972b47829b4003763f5d73a79192cb248a;p=lilypond.git diff --git a/scripts/build/website_post.py b/scripts/build/website_post.py index 6ad2d5995e..c31aa06cd9 100644 --- a/scripts/build/website_post.py +++ b/scripts/build/website_post.py @@ -1,7 +1,7 @@ #!@PYTHON@ #-*- coding: utf-8 -*- -##### This is web_post.py. This script deals with translations +##### This is website_post.py. This script deals with translations ##### in the "make website" target. import sys @@ -11,6 +11,10 @@ import re ###### Translation data, move out, see create-weblinks-itexi.py translations = { + 'ca': { + 'English': 'Català', + 'Other languages': 'Altres idiomes', + }, 'cs': { 'English': 'Česky', 'Other languages': 'Jiné jazyky', @@ -45,11 +49,11 @@ translations = { }, 'zh': { 'English': '中文', - 'Other languages': '其它语言', + 'Other languages': '其他语言', }, } -# needs at least: make -C po or make- C Documentation/po +# needs at least: make -C po or make -C Documentation/po HAVE_GETTEXT = False #### this breaks on lilypond.org @@ -111,12 +115,14 @@ def addLangExt(filename, lang, ext): return text def makeFooter (filename, currentLang): - # TODO: add link to automatic language selection? - # still need to include this page in the new webpages somewhere footer = '''

+ %(other)s: %(lst)s. +
+%(browser_language)s

''' + me = sys.argv[0] def link (lang): str = '''%(language_name)s''' file_name = addLangExt (filename, lang, 'html') @@ -124,6 +130,9 @@ def makeFooter (filename, currentLang): return str % locals () lst = ', '.join ([link (lang) for lang in langs if lang != currentLang]) other = _ ('Other languages', currentLang) + browser_lang = _ ('About automatic language selection.', currentLang) + browser_language_url = "http://www.lilypond.org/website/misc/browser-language" + browser_language = browser_lang % browser_language_url return footer % locals () def getLocalHref(line): @@ -153,7 +162,7 @@ for file in html_files: lang = '' # possibly necessary for automatic language selection file_symlink = file.replace(".html", ".en.html") - if (not (os.path.exists(file_symlink))): + if not os.path.lexists (file_symlink): os.symlink (file, file_symlink) elif (len(file_split) == 3): # it's a translation @@ -189,21 +198,24 @@ for file in html_files: ### add google tracker header if (line.find("") >= 0): outfile.write(""" - """); #### add google tracker goals if (line.find("href=\"http://download.linuxaudio.org") >= 0): # TODO: more ugly hardcoding to make releases hard. :( - if (line.find('2.12') >= 0): - line = line.replace('a href=', 'a onClick=\"javascript:urchinTracker(\'/download/v2.12\');\" href=') - elif (line.find('2.13') >= 0): - line = line.replace('a href=', 'a onClick=\"javascript:urchinTracker(\'/download/v2.13\');\" href=') + if (line.find('2.16') >= 0): + line = line.replace('a href=', 'a onClick=\"javascript:urchinTracker(\'/download/v2.16\');\" href=') + elif (line.find('2.17') >= 0): + line = line.replace('a href=', 'a onClick=\"javascript:urchinTracker(\'/download/v2.17\');\" href=') ### add language selection footer if (line.find("
") >= 0): outfile.write("
\n") @@ -212,4 +224,3 @@ urchinTracker(); outfile.write("
\n") outfile.write(line) outfile.close() -