X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=scripts%2Fbuild%2Fcreate-weblinks-itexi.py;h=7e0c6551a32d130d7a4a2e7955303b9c709cba8f;hb=4a43b188e846b0f97dd79b117b5952d71a2b15a7;hp=c48b0085b0d82588be85030fdb794bc387676f7f;hpb=2f320e9722ec20d6f13ec567d007763cc912c5da;p=lilypond.git diff --git a/scripts/build/create-weblinks-itexi.py b/scripts/build/create-weblinks-itexi.py index c48b0085b0..7e0c6551a3 100644 --- a/scripts/build/create-weblinks-itexi.py +++ b/scripts/build/create-weblinks-itexi.py @@ -1,6 +1,6 @@ #!@PYTHON@ # -*- coding: utf-8 -*- -# create-version-itexi.py +# create-weblinks-itexi.py """ when being called on lilypond.org, pass it the location of the top source dir on the command-line. """ @@ -9,14 +9,22 @@ import sys import os import glob -# these links are relative from /website/ on lilypond.org -depth = "../" - ### translation data -- shouldn't be here; see issue ### http://code.google.com/p/lilypond/issues/detail?id=1050 -#langs = ['', 'cs', 'de', 'es', 'fr', 'hu', 'it', 'ja', 'nl', 'zh'] -langs = ['', 'cs', 'de', 'es', 'fr', 'hu', 'it', 'ja', 'nl', 'zh'] +import langdefs +# GUB only has python 2.4 !!! +# langs = [i.code if i.code != 'en' else '' for i in langdefs.WEB_LANGUAGES] +langs = [] +for lang in langdefs.WEB_LANGUAGES: + if lang.code == 'en': + langs.append('') + else: + langs.append(lang.code) + + +# these links are relative from /website/ on lilypond.org +depth = "../" # Get/update node translations ''' @@ -50,6 +58,10 @@ translations = { 'Regression tests for ': 'Regressionstests für ', 'PDF of regtests for ': 'PDF der Regressionstests für ', + 'abc2ly Regression tests for ': 'abc2ly Regressionstests für ', + 'PDF of abc2ly regtests for ': 'PDF der abc2ly Regressionstests für ', + 'lilypond-book Regression tests for ': 'lilypond-book Regressionstests für ', + 'PDF of lilypond-book regtests for ': 'PDF der lilypond-book Regressionstests für ', 'MusicXML Regression tests for ': 'MusicXML Regressionstests für ', 'PDF of MusicXML regtests for ': 'PDF der MusicXML Regressionstests für ', @@ -77,6 +89,10 @@ translations = { 'Regression tests for ': 'Pruebas de regresión para ', 'PDF of regtests for ': 'Pruebas en PDF para ', + 'abc2ly Regression tests for ': 'Pruebas de regresión de abc2ly para ', + 'PDF of abc2ly regtests for ': 'Pruebas de abc2ly en PDF para ', + 'lilypond-book Regression tests for ': 'Pruebas de regresión de lilypond-book para ', + 'PDF of lilypond-book regtests for ': 'Pruebas de lilypond-book en PDF para ', 'MusicXML Regression tests for ': 'Pruebas de regresión de MusicXML para ', 'PDF of MusicXML regtests for ': 'Pruebas de MusicXML en PDF para ', @@ -104,6 +120,10 @@ translations = { 'Regression tests for ': 'Tests de régression pour ', 'PDF of regtests for ': 'PDF des tests de régression pour ', + 'abc2ly Regression tests for ': 'Tests de régression de abc2ly pour ', + 'PDF of abc2ly regtests for ': 'PDF des tests de régression de abc2ly pour ', + 'lilypond-book Regression tests for ': 'Tests de régression de lilypond-book pour ', + 'PDF of lilypond-book regtests for ': 'PDF des tests de régression de lilypond-book pour ', 'MusicXML Regression tests for ': 'Tests de régression de MusicXML pour ', 'PDF of MusicXML regtests for ': 'PDF des tests de régression de MusicXML pour ', @@ -129,12 +149,46 @@ translations = { 'Regression tests for ': 'Regressziós tesztek - verzió: ', 'PDF of regtests for ': 'PDF formátumban - verzió: ', + 'abc2ly Regression tests for ': 'abc2ly regressziós tesztek - verzió: ', + 'PDF of abc2ly regtests for ': 'PDF formátumban - verzió: ', + 'lilypond-book Regression tests for ': 'lilypond-book regressziós tesztek - verzió: ', + 'PDF of lilypond-book regtests for ': 'PDF formátumban - verzió: ', 'MusicXML Regression tests for ': 'MusicXML regressziós tesztek - verzió: ', 'PDF of MusicXML regtests for ': 'PDF formátumban - verzió: ', 'Doc tarball for ': 'Tömörített csomag - verzió: ', ' (did not exist in 2.12)': ' (nem létezett a 2.12-es verzióban)', }, + 'it': { + 'Source': 'Sorgenti', + 'Learning': 'Apprendimento', + 'Music glossary': 'Glossario', + 'Essay': 'Saggio', + 'Notation': 'Notazione', + 'Usage': 'Uso', + 'Snippets': 'Frammenti', + 'Web': 'Web', + 'Changes': 'Cambiamenti', + 'Extending': 'Estendere', + 'Internals': 'Funzionamento interno', + 'Contributor': 'Guida del collaboratore', + +# keep the spaces! + ' (split HTML)': ' (HTML multipagina)', + ' (big HTML)': ' (HTML pagina unica)', + + 'Regression tests for ': 'Test di collaudo per ', + 'PDF of regtests for ': 'PDF dei test di collaudo per ', + 'abc2ly Regression tests for ': 'Test di collaudo di abc2ly per ', + 'PDF of abc2ly regtests for ': 'PDF dei test di collaudo di abc2ly per ', + 'lilypond-book Regression tests for ': 'Test di collaudo di lilypond-book per ', + 'PDF of lilypond-book regtests for ': 'PDF dei test di collaudo di lilypond-book per ', + 'MusicXML Regression tests for ': 'Test di collaudo di MusicXML per ', + 'PDF of MusicXML regtests for ': 'PDF dei test di collaudo di MusicXML per ', + + 'Doc tarball for ': 'Archivio della documentazione per ', + ' (did not exist in 2.12)': ' (non disponibile per la versione 2.12)', + }, 'ja': { 'Source': 'ソース', 'Learning': '学習', @@ -157,6 +211,10 @@ translations = { 'Regression tests for ': '回帰テスト バージョン ', 'PDF of regtests for ': '回帰テスト (PDF 版) バージョン ', + 'abc2ly Regression tests for ': 'abc2ly 回帰テスト バージョン ', + 'PDF of abc2ly regtests for ': 'abc2ly 回帰テスト (PDF 版) バージョン ', + 'lilypond-book Regression tests for ': 'lilypond-book 回帰テスト バージョン ', + 'PDF of lilypond-book regtests for ': 'lilypond-book 回帰テスト (PDF 版) バージョン ', 'MusicXML Regression tests for ': 'MusicXML 回帰テスト バージョン ', 'PDF of MusicXML regtests for ': 'MusicXML 回帰テスト (PDF 版) バージョン ', @@ -185,6 +243,10 @@ translations = { 'Regression tests for ': 'Regressietesten voor ', 'PDF of regtests for ': 'PDF van regressietesten voor ', + 'abc2ly Regression tests for ': 'abc2ly regressietesten voor ', + 'PDF of abc2ly regtests for ': 'abc2ly regressietesten voor ', + 'lilypond-book Regression tests for ': 'lilypond-book regressietesten voor ', + 'PDF of lilypond-book regtests for ': 'lilypond-book regressietesten voor ', 'MusicXML Regression tests for ': 'MusicXML regressietesten voor ', 'PDF of MusicXML regtests for ': 'MusicXML regressietesten voor ', @@ -196,27 +258,31 @@ translations = { 'Learning': '学习', 'Music glossary': '音乐术语表', 'Essay': '文章', - 'Notation': '五线谱', + 'Notation': '记谱法', 'Usage': '使用', 'Snippets': '片断', 'Web': 'Web', 'Changes': '变化', 'Extending': '扩展', - 'Internals': '内部', + 'Internals': '内部机制', 'Contributor': '贡献者', # keep the spaces! - ' (split HTML)': ' (分开的HTML', - ' (big HTML)': ' (大的HTML)', - - 'Regression tests for ': '回归测试', - 'PDF of regtests for ': '回归的PDF', - 'MusicXML Regression tests for ': 'MusicXML回归测试', - 'PDF of MusicXML regtests for ': 'MusicXML的PDF回归', + ' (split HTML)': ' (分开的 HTML)', + ' (big HTML)': ' (大的 HTML)', + + 'Regression tests for ': '回归测试 ', + 'PDF of regtests for ': '回归测试的 PDF ', + 'abc2ly Regression tests for ': 'abc2ly 回归测试 ', + 'PDF of abc2ly regtests for ': 'abc2ly 的 PDF 回归测试 ', + 'lilypond-book Regression tests for ': 'lilypond-book 回归测试 ', + 'PDF of lilypond-book regtests for ': 'lilypond-book 的 PDF 回归测试 ', + 'MusicXML Regression tests for ': 'MusicXML 回归测试 ', + 'PDF of MusicXML regtests for ': 'MusicXML 的 PDF 回归测试 ', 'Doc tarball for ': '为文档压缩包', - ' (did not exist in 2.12)': ' (在2.12中不存在)', + ' (did not exist in 2.12)': ' (在 2.12 中不存在)', }, } @@ -267,11 +333,13 @@ for line in version_contents: VERSION = str(major)+'.'+str(minor)+'.'+str(patch) def _ (string, lang): - return translations.get (lang.split ('_')[0], {}).get (string, string) + return translations.get (lang.split ('_')[0], {}).get (string, None) getTrans = _ # let's not barf, but print a warning when something's missing def getTrans(text, lang): + if not lang: + return text trans = _ (text, lang) if not trans: trans = text @@ -279,7 +347,7 @@ def getTrans(text, lang): return trans def macroLang(name, lang): - if (lang != ''): + if lang: return name + '-' + lang return name @@ -300,7 +368,9 @@ def make_download(name, osA, osB, version, revision, text): string += "}" make_macro(name, string) -def make_download_source(name, vstring, version, lang): +def make_download_source(name, version, lang): + assert "." in version + vstring = "v%s.%s" % tuple(version.split(".", 2)[0:2]) string = "@uref{http://download.linuxaudio.org/lilypond/sources/" string += vstring + "/" string += "lilypond-" + version + ".tar.gz" @@ -312,11 +382,11 @@ def make_download_source(name, vstring, version, lang): def make_all_downloads(macroName, version): make_download("download"+macroName+"LinuxNormal", "linux-x86/", - "linux-x86.sh", version, "1", "Linux x86") + "linux-x86.sh", version, "1", "GNU/Linux x86") make_download("download"+macroName+"LinuxBig", "linux-64/", - "linux-64.sh", version, "1", "Linux 64") + "linux-64.sh", version, "1", "GNU/Linux 64") make_download("download"+macroName+"LinuxPPC", "linux-ppc/", - "linux-ppc.sh", version, "1", "Linux PPC") + "linux-ppc.sh", version, "1", "GNU/Linux PPC") make_download("download"+macroName+"FreeBSDNormal", "freebsd-x86/", "freebsd-x86.sh", version, "1", "FreeBSD i386") @@ -409,9 +479,9 @@ def make_manual_links(name, version, lang): "http://lilypond.org", mshort+getTrans(" (did not exist in 2.12)",lang)) continue - # this is stupid and I shouldn't have bothered trying - # to support the 2.12 docs and it will be deleted once - # 2.14 is out and the website won't be visible to users + # this is stupid and I shouldn't have bothered trying + # to support the 2.12 docs and it will be deleted once + # 2.14 is out and the website won't be visible to users # until 2.14 is out. -gp if (url.endswith('.html')): make_ver_link(macroLang("manual"+name+mshort+'Pdf',lang), @@ -482,30 +552,40 @@ def make_doctarball_links(name, version, lang): make_ver_link(macroLang("doctarball"+name, lang), url, getTrans("Doc tarball for ", lang)+version) +print "@c This file was autogenerated" +print "@c from: %s" % VERSION +print "@c by: %s" % sys.argv[0] +print "" print "@c ************************ Download binaries ************" +print "" + make_all_downloads("Stable", VERSION_STABLE) make_all_downloads("Devel", VERSION_DEVEL) print "@c ************************ Download source ************" -# FIXME: icky hard-coding! -gp +print "" + for lang in langs: - print "@c *********", lang, "***" - make_download_source("downloadStableSource","v2.14",VERSION_STABLE,lang) - make_download_source("downloadDevelSource","v2.15",VERSION_DEVEL,lang) + print "@c *********", lang or "en", "***" + make_download_source("downloadStableSource", VERSION_STABLE, lang) + make_download_source("downloadDevelSource", VERSION_DEVEL, lang) print "@c ************************ Manual links ************" +print "" + for lang in langs: - print "@c *********", lang, "***" - make_manual_links("Stable", VERSION_STABLE,lang) - make_manual_links("Devel", VERSION_DEVEL,lang) + print "@c *********", lang or "en", "***" + make_manual_links("Stable", VERSION_STABLE, lang) + make_manual_links("Devel", VERSION_DEVEL, lang) - make_doctarball_links("Stable", VERSION_STABLE,lang) - make_doctarball_links("Devel", VERSION_DEVEL,lang) + make_doctarball_links("Stable", VERSION_STABLE, lang) + make_doctarball_links("Devel", VERSION_DEVEL, lang) print "@c ************************ Regtest links ************" -for lang in langs: - print "@c *********", lang, "***" - make_regtest_links("Stable", VERSION_STABLE,lang) - make_regtest_links("Devel", VERSION_DEVEL,lang) - +print "" +for lang in langs: + print "@c *********", lang or "en", "***" + make_regtest_links("Stable", VERSION_STABLE, lang) + make_regtest_links("Devel", VERSION_DEVEL, lang) +print "@c ***************************************************"