X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=scripts%2Fbuild%2Fcreate-weblinks-itexi.py;h=29a90151c63d77df2c7bc58e664a5cbba6e0433a;hb=17183f4a9696f2187128490a669895964959fa84;hp=d9ca28f01194afc4297392e076e09af469bb8366;hpb=dd8957f427c18ac448be3e0e0d84110c599430aa;p=lilypond.git diff --git a/scripts/build/create-weblinks-itexi.py b/scripts/build/create-weblinks-itexi.py index d9ca28f011..29a90151c6 100644 --- a/scripts/build/create-weblinks-itexi.py +++ b/scripts/build/create-weblinks-itexi.py @@ -9,17 +9,26 @@ 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 = ['', 'de', 'es', 'fr', 'hu', 'it', 'ja', 'nl'] +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 ''' -for i in de es fr hu it ja nl; do +for i in cs de es fr hu it ja nl zh; do echo "'"$i"': {" (echo '--' ; grep -nH -B1 translationof Documentation/$i/web/* ) \ | pytt '^--\n.*@(?:unnum|sub)[^ ]* (.*)\n.*@translationof (.*)\n' "'\2': '\1',\n" \ @@ -29,6 +38,32 @@ done ''' translations = { + 'de': { + 'Source': 'Quellen', + 'Learning': 'Einführung', + 'Music glossary': 'Glossar', + 'Essay': 'Aufsatz', + 'Notation': 'Notation', + 'Usage': 'Benutzung', + 'Snippets': 'Schnipsel', + 'Web': 'Web', + 'Changes': 'Änderungen', + + 'Extending': 'Erweitern', + 'Internals': 'Interna', + 'Contributor': 'Beitragen', + + ' (split HTML)': ' (geteiltes HTML)', + ' (big HTML)': ' (großes HTML)', + + 'Regression tests for ': 'Regressionstests für ', + 'PDF of regtests for ': 'PDF der Regressionstests für ', + 'MusicXML Regression tests for ': 'MusicXML Regressionstests für ', + 'PDF of MusicXML regtests for ': 'PDF der MusicXML Regressionstests für ', + + 'Doc tarball for ': 'Dokumentation tar-gepackt für ', + ' (did not exist in 2.12)': ' (nicht existent in 2.12)', + }, 'es': { 'Source': 'Código fuente', @@ -83,60 +118,6 @@ translations = { 'Doc tarball for ': 'Archive de la documentation pour ', ' (did not exist in 2.12)': ' (non disponible pour la version 2.12)', }, - 'nl': { - 'Source': 'Broncode', - - 'Learning': 'Beginnen', - 'Music glossary': 'Terminologie', - 'Essay': 'Essay', - 'Notation': 'Notatie', - 'Usage': 'Gebruik', - 'Snippets': 'Snippers', - 'Web': 'Web', - 'Changes': 'Veranderingen', - 'Extending': 'Uitbreidingen', - 'Internals': 'Internals', - 'Contributor': 'Contributor', - -# keep the spaces! - ' (split HTML)': ' (opgesplitste HTML)', - ' (big HTML)': ' (grote pagina HTML)', - - 'Regression tests for ': 'Regressietesten voor ', - 'PDF of regtests for ': 'PDF van regressietesten voor ', - 'MusicXML Regression tests for ': 'MusicXML regressietesten voor ', - 'PDF of MusicXML regtests for ': 'MusicXML regressietesten voor ', - - 'Doc tarball for ': 'Tarball met documentation voor ', - ' (did not exist in 2.12)': ' (bestond nog niet in 2.12)', - }, - 'de': { - 'Source': 'Quellen', - 'Learning': 'Einführung', - 'Music glossary': 'Glossar', - 'Essay': 'Aufsatz', - 'Notation': 'Notation', - 'Usage': 'Benutzung', - 'Snippets': 'Schnipsel', - 'Web': 'Web', - 'Changes': 'Änderungen', - - #TODO - 'Extending': 0, - 'Internals': 'Interna', - 'Contributor': 0, - - ' (split HTML)': 0, - ' (big HTML)': 0, - - 'Regression tests for ': 0, - 'PDF of regtests for ': 0, - 'MusicXML Regression tests for ': 0, - 'PDF of MusicXML regtests for ': 0, - - 'Doc tarball for ': 0, - ' (did not exist in 2.12)': 0, - }, 'hu': { 'Source': 'Forrás', 'Learning': 'Tankönyv', @@ -147,22 +128,20 @@ translations = { 'Snippets': 'Kódrészletek', 'Web': 'Web', 'Changes': 'Változások', - - #TODO - 'Extending': 0, + 'Extending': 'Bővítés', 'Internals': 'Belső működés', - 'Contributor': 0, + 'Contributor': 'Közreműködés', - ' (split HTML)': 0, - ' (big HTML)': 0, + ' (split HTML)': ' (HTML oldalak)', + ' (big HTML)': ' (egy nagy HTML oldal)', - 'Regression tests for ': 0, - 'PDF of regtests for ': 0, - 'MusicXML Regression tests for ': 0, - 'PDF of MusicXML regtests for ': 0, + 'Regression tests for ': 'Regressziós tesztek - verzió: ', + 'PDF of 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 ': 0, - ' (did not exist in 2.12)': 0, + 'Doc tarball for ': 'Tömörített csomag - verzió: ', + ' (did not exist in 2.12)': ' (nem létezett a 2.12-es verzióban)', }, 'ja': { 'Source': 'ソース', @@ -176,21 +155,76 @@ translations = { 'Changes': '変更点', #TODO - 'Extending': 0, + 'Extending': '拡張', 'Internals': '内部リファレンス', - 'Contributor': 0, + 'Contributor': '貢献者向けガイド', + +# keep the spaces! + ' (split HTML)': ' (ページ毎に分割された HTML)', + ' (big HTML)': ' (1 つの大きな HTML)', + + 'Regression tests for ': '回帰テスト バージョン ', + 'PDF of regtests for ': '回帰テスト (PDF 版) バージョン ', + 'MusicXML Regression tests for ': 'MusicXML 回帰テスト バージョン ', + 'PDF of MusicXML regtests for ': 'MusicXML 回帰テスト (PDF 版) バージョン ', + + 'Doc tarball for ': 'ドキュメント アーカイブ バージョン ', + ' (did not exist in 2.12)': ' (バージョン 2.12 には存在しません)', + + }, + 'nl': { + 'Source': 'Broncode', + + 'Learning': 'Beginnen', + 'Music glossary': 'Terminologie', + 'Essay': 'Essay', + 'Notation': 'Notatie', + 'Usage': 'Gebruik', + 'Snippets': 'Snippers', + 'Web': 'Web', + 'Changes': 'Veranderingen', + 'Extending': 'Uitbreidingen', + 'Internals': 'Internals', + 'Contributor': 'Contributor', + +# keep the spaces! + ' (split HTML)': ' (opgesplitste HTML)', + ' (big HTML)': ' (grote pagina HTML)', + + 'Regression tests for ': 'Regressietesten voor ', + 'PDF of regtests for ': 'PDF van regressietesten voor ', + 'MusicXML Regression tests for ': 'MusicXML regressietesten voor ', + 'PDF of MusicXML regtests for ': 'MusicXML regressietesten voor ', - ' (split HTML)': 0, - ' (big HTML)': 0, + 'Doc tarball for ': 'Tarball met documentation voor ', + ' (did not exist in 2.12)': ' (bestond nog niet in 2.12)', + }, + 'zh': { + 'Source': '源码', + 'Learning': '学习', + 'Music glossary': '音乐术语表', + 'Essay': '文章', + 'Notation': '五线谱', + 'Usage': '使用', + 'Snippets': '片断', + 'Web': 'Web', + 'Changes': '变化', - 'Regression tests for ': 0, - 'PDF of regtests for ': 0, - 'MusicXML Regression tests for ': 0, - 'PDF of MusicXML regtests for ': 0, + 'Extending': '扩展', + 'Internals': '内部', + 'Contributor': '贡献者', - 'Doc tarball for ': 0, - ' (did not exist in 2.12)': 0, +# 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回归', + 'Doc tarball for ': '为文档压缩包', + ' (did not exist in 2.12)': ' (在2.12中不存在)', }, } @@ -320,8 +354,6 @@ def translateNameToUrl(manual, version): ver_minor = ver_split[0] + '.' + ver_split[1] url = depth + "doc/v" + ver_minor + "/Documentation/" - if (ver_minor == '2.13'): - return url+manual if (ver_minor == '2.12'): if (manual=='learning'): return url+'user/lilypond-learning' @@ -343,7 +375,15 @@ def translateNameToUrl(manual, version): return url+'user/lilypond/Interfaces-for-programmers.html' else: return '' + else: + return url+manual +def addLang(url, lang): + if lang: + base, ext = os.path.splitext(url) + return base + '.' + lang + ext + else: + return url def make_manual_links(name, version, lang): """Here is where all the macros manualStableLearningSplit, @@ -377,27 +417,39 @@ def make_manual_links(name, version, lang): "http://lilypond.org", mshort+getTrans(" (did not exist in 2.12)",lang)) continue - make_ver_link(macroLang("manual"+name+mshort+'Pdf',lang), - url + '.pdf', - getTrans(manual.capitalize(),lang) + '.pdf') - make_ver_link(macroLang("manual"+name+mshort+'Split',lang), - url + '/index.html', - getTrans(manual.capitalize(),lang) + - getTrans(' (split HTML)',lang)) - make_ver_link(macroLang("manual"+name+mshort+'Big',lang), - url + '-big-page.html', - getTrans(manual.capitalize(),lang) + - getTrans(' (big HTML)',lang)) - # 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), + addLang(url, lang), + getTrans(manual.capitalize(),lang) + '.pdf') + make_ver_link(macroLang("manual"+name+mshort+'Split',lang), + addLang(url, lang), + getTrans(manual.capitalize(),lang) + + getTrans(' (split HTML)',lang)) + make_ver_link(macroLang("manual"+name+mshort+'Big',lang), + addLang(url, lang), + getTrans(manual.capitalize(),lang) + + getTrans(' (big HTML)',lang)) newurl = url else: + make_ver_link(macroLang("manual"+name+mshort+'Pdf',lang), + # TODO: this is an even stupider way of doing it + addLang(url+'.pdf', lang), + getTrans(manual.capitalize(),lang) + '.pdf') + make_ver_link(macroLang("manual"+name+mshort+'Split',lang), + addLang(url + '/index.html', lang), + getTrans(manual.capitalize(),lang) + + getTrans(' (split HTML)',lang)) + make_ver_link(macroLang("manual"+name+mshort+'Big',lang), + addLang(url + '-big-page.html', lang), + getTrans(manual.capitalize(),lang) + + getTrans(' (big HTML)',lang)) newurl = url + '/index.html' make_ver_link(macroLang("manual"+name+mshort+'SplitNoName',lang), - newurl, + addLang(newurl, lang), getTrans(manual.capitalize(),lang)) def make_regtest_links(name, version, lang): @@ -414,9 +466,21 @@ def make_regtest_links(name, version, lang): make_ver_link(macroLang("regtest"+name+"Xml", lang), url+"musicxml/collated-files.html", getTrans("MusicXML Regression tests for ", lang)+version) + make_ver_link(macroLang("regtest"+name+"Abc", lang), + url+"abc2ly/collated-files.html", + getTrans("abc2ly Regression tests for ", lang)+version) + make_ver_link(macroLang("regtest"+name+"LilypondBook", lang), + url+"lilypond-book/collated-files.html", + getTrans("lilypond-book Regression tests for ", lang)+version) make_ver_link(macroLang("regtest"+name+"XmlPdf", lang), - url+"musicxml/collated-files.html", + url+"musicxml/collated-files.pdf", getTrans("PDF of MusicXML regtests for ", lang)+version) + make_ver_link(macroLang("regtest"+name+"AbcPdf", lang), + url+"abc2ly/collated-files.pdf", + getTrans("PDF of abc2ly regtests for ", lang)+version) + make_ver_link(macroLang("regtest"+name+"LilypondBookPdf", lang), + url+"lilypond-book/collated-files.pdf", + getTrans("PDF of lilypond-book regtests for ", lang)+version) def make_doctarball_links(name, version, lang): url = depth + "download/binaries/documentation/lilypond-" @@ -434,8 +498,8 @@ print "@c ************************ Download source ************" # FIXME: icky hard-coding! -gp for lang in langs: print "@c *********", lang, "***" - make_download_source("downloadStableSource","v2.12",VERSION_STABLE,lang) - make_download_source("downloadDevelSource","v2.13",VERSION_DEVEL,lang) + make_download_source("downloadStableSource","v2.14",VERSION_STABLE,lang) + make_download_source("downloadDevelSource","v2.15",VERSION_DEVEL,lang) print "@c ************************ Manual links ************" for lang in langs: