LEFT | RIGHT |
(no file at all) | |
1 #!@PYTHON@ | 1 #!@PYTHON@ |
2 #-*- coding: utf-8 -*- | 2 #-*- coding: utf-8 -*- |
3 | 3 |
4 """ | 4 """ |
5 Documentation i18n module | 5 Documentation i18n module |
6 """ | 6 """ |
7 | 7 |
8 import re | 8 import re |
9 import sys | 9 import sys |
10 import os | 10 import os |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 hu = LanguageDef ('hu', 'magyar') | 66 hu = LanguageDef ('hu', 'magyar') |
67 it = LanguageDef ('it', 'italiano') | 67 it = LanguageDef ('it', 'italiano') |
68 ja = LanguageDef ('ja', '日本語', enable_ly_identifier_l10n=False) | 68 ja = LanguageDef ('ja', '日本語', enable_ly_identifier_l10n=False) |
69 nl = LanguageDef ('nl', 'nederlands') | 69 nl = LanguageDef ('nl', 'nederlands') |
70 zh = LanguageDef ('zh', '中文', enable_ly_identifier_l10n=False) | 70 zh = LanguageDef ('zh', '中文', enable_ly_identifier_l10n=False) |
71 | 71 |
72 # Outdated or broken translations may be disabled | 72 # Outdated or broken translations may be disabled |
73 # (please run 'make doc-clean' before doing that): | 73 # (please run 'make doc-clean' before doing that): |
74 #fr.enabled = False | 74 #fr.enabled = False |
75 | 75 |
76 # LANGUAGES = (site, cs, de, es, fr, hu, it, ja, nl, zh) | |
77 LANGUAGES = (site, cs, de, es, fr, hu, it, ja, nl, zh) | 76 LANGUAGES = (site, cs, de, es, fr, hu, it, ja, nl, zh) |
| 77 WEB_LANGUAGES = (site, cs, de) |
| 78 |
| 79 if os.getenv("MAKEWEB") == '1': |
| 80 LANGUAGES=WEB_LANGUAGES |
78 | 81 |
79 if __name__ == '__main__': | 82 if __name__ == '__main__': |
80 print ' '.join ([l.code for l in LANGUAGES if l.enabled and l.code != 'en']) | 83 print ' '.join ([l.code for l in LANGUAGES if l.enabled and l.code != 'en']) |
81 else: | 84 else: |
82 LANGDICT = {} | 85 LANGDICT = {} |
83 for l in LANGUAGES: | 86 for l in LANGUAGES: |
84 LANGDICT[l.code] = l | 87 LANGDICT[l.code] = l |
85 | 88 |
86 try: | 89 try: |
87 import gettext | 90 import gettext |
88 | 91 |
89 translation = {} | 92 translation = {} |
90 for l in LANGUAGES: | 93 for l in LANGUAGES: |
91 if l.enabled and l.code != 'en': | 94 if l.enabled and l.code != 'en': |
92 t = gettext.translation('lilypond-doc', | 95 t = gettext.translation('lilypond-doc', |
93 os.environ['LYDOC_LOCALEDIR'], | 96 os.environ['LYDOC_LOCALEDIR'], |
94 [l.code]) | 97 [l.code]) |
95 translation[l.code] = t.gettext | 98 translation[l.code] = t.gettext |
96 except: | 99 except: |
97 if os.environ.has_key ('LYDOC_LOCALEDIR'): | 100 if os.environ.has_key ('LYDOC_LOCALEDIR'): |
98 sys.stderr.write ('langdefs.py: warning: lilypond-doc gettext domain
not found.\n') | 101 sys.stderr.write ('langdefs.py: warning: lilypond-doc gettext domain
not found.\n') |
99 translation = dict ([(l.code, lambda x: x) for l in LANGUAGES]) | 102 translation = dict ([(l.code, lambda x: x) for l in LANGUAGES]) |
LEFT | RIGHT |