]> git.donarmstrong.com Git - lilypond.git/blobdiff - scripts/build/website_post.py
Emit warnings for missing translations.
[lilypond.git] / scripts / build / website_post.py
index ba2432e1967e6fe585acaf9f38f299de325cb18c..312795e3a1c9cd3251c532c864972ae7e2e0f0d8 100644 (file)
@@ -13,7 +13,7 @@ import re
 translations = {
     'cs': {
         'English': 'Česky',
-        'Other languages': 'Other languages',
+        'Other languages': 'Jiné jazyky',
         },
     'de': {
         'English': 'Deutsch',
@@ -45,11 +45,11 @@ translations = {
         },
     'zh': {
         'English': '中文',
-        'Other languages': 'Other languages',
+        'Other languages': '其他语言',
         },
     }
 
-# needs at least: make -C po or makeC Documentation/po
+# needs at least: make -C po or make -C Documentation/po
 HAVE_GETTEXT = False
 
 ####  this breaks on lilypond.org
@@ -111,10 +111,10 @@ 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 = '''<p id="languages">
 %(other)s: %(lst)s.
+<br>
+%(browser_language)s
 </p>
 '''
     def link (lang):
@@ -124,6 +124,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 <a href="%s">automatic language selection</a>.', 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 +156,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
@@ -181,10 +184,10 @@ for file in html_files:
             # questionable
             if (not link.startswith("../doc/")):
                 if (link.endswith(".html")):
-                   langlink = addLangExt(link[:-5], lang, "html")
+                    langlink = addLangExt(link[:-5], lang, "html")
                     line = line.replace(link, langlink)
                 if (link.endswith(".pdf")):
-                   langlink = addLangExt(link[:-4], lang, "pdf")
+                    langlink = addLangExt(link[:-4], lang, "pdf")
                     line = line.replace(link, langlink)
         ### add google tracker header
         if (line.find("</head>") >= 0):
@@ -200,10 +203,10 @@ urchinTracker();
         #### 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("<div id=\"verifier_texinfo\">") >= 0):
             outfile.write("<div id=\"footer\">\n")