X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=scripts%2Fbuild%2Fwebsite_post.py;h=ba2432e1967e6fe585acaf9f38f299de325cb18c;hb=61c74b255b9ee12194853a97e0c2fe2882777f8f;hp=a1d2215f29d95d5ad07597487e9066d9b421e87d;hpb=e00fb6b908d0bbe7157f6765529ca66ebee3f126;p=lilypond.git diff --git a/scripts/build/website_post.py b/scripts/build/website_post.py index a1d2215f29..ba2432e196 100644 --- a/scripts/build/website_post.py +++ b/scripts/build/website_post.py @@ -11,6 +11,10 @@ import re ###### Translation data, move out, see create-weblinks-itexi.py translations = { + 'cs': { + 'English': 'Česky', + 'Other languages': 'Other languages', + }, 'de': { 'English': 'Deutsch', 'Other languages': 'Andere Sprachen', @@ -32,13 +36,17 @@ translations = { 'Other languages': 'Altre lingue', }, 'ja': { - 'English': 'Japanese', + 'English': '日本語', 'Other languages': '他の言語', }, 'nl': { 'English': 'Nederlands', 'Other languages': 'Andere talen', }, + 'zh': { + 'English': '中文', + 'Other languages': 'Other languages', + }, } # needs at least: make -C po or make- C Documentation/po @@ -170,16 +178,38 @@ for file in html_files: ### alter links as appropriate link = getLocalHref(line) if (link != ""): - # quesitonable - if (link.endswith(".html")): - langlink = addLangExt(link[:-5], lang, "html") - line = line.replace(link, langlink) - if (link.endswith(".pdf")): - langlink = addLangExt(link[:-4], lang, "pdf") - line = line.replace(link, langlink) + # questionable + if (not link.startswith("../doc/")): + if (link.endswith(".html")): + langlink = addLangExt(link[:-5], lang, "html") + line = line.replace(link, langlink) + if (link.endswith(".pdf")): + langlink = addLangExt(link[:-4], lang, "pdf") + line = line.replace(link, langlink) + ### 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=') ### add language selection footer - if (line.find("") >= 0): + if (line.find("
") >= 0): + outfile.write("
\n") outfile.write( lang_footer ) + if (line.find("= 0): + outfile.write("
\n") outfile.write(line) outfile.close()