OLD | NEW |
1 #-*- coding: utf-8 -*- | 1 #-*- coding: utf-8 -*- |
2 | 2 |
3 """ | 3 """ |
4 Documentation i18n module | 4 Documentation i18n module |
5 """ | 5 """ |
6 | 6 |
7 import re | 7 import re |
8 import sys | 8 import sys |
9 import os | 9 import os |
10 | 10 |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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, ca, cs, de, es, fr, hu, it, ja, nl, zh) | 76 LANGUAGES = (site, ca, cs, de, es, fr, hu, it, ja, nl, zh) |
77 WEB_LANGUAGES = (site, ca, cs, de, es, fr, hu, it, ja, nl, zh) | 77 WEB_LANGUAGES = (site, ca, cs, de, es, fr, hu, it, ja, nl, zh) |
78 | 78 |
79 if os.getenv("MAKEWEB") == '1': | 79 if os.getenv("MAKEWEB") == '1': |
80 LANGUAGES=WEB_LANGUAGES | 80 LANGUAGES=WEB_LANGUAGES |
81 | 81 |
82 if __name__ == '__main__': | 82 if __name__ == '__main__': |
83 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'])
) |
84 else: | 84 else: |
85 LANGDICT = {} | 85 LANGDICT = {} |
86 for l in LANGUAGES: | 86 for l in LANGUAGES: |
87 LANGDICT[l.code] = l | 87 LANGDICT[l.code] = l |
88 | 88 |
89 try: | 89 try: |
90 import gettext | 90 import gettext |
91 | 91 |
92 translation = {} | 92 translation = {} |
93 for l in LANGUAGES: | 93 for l in LANGUAGES: |
94 if l.enabled and l.code != 'en': | 94 if l.enabled and l.code != 'en': |
95 t = gettext.translation('lilypond-doc', | 95 t = gettext.translation('lilypond-doc', |
96 os.environ['LYDOC_LOCALEDIR'], | 96 os.environ['LYDOC_LOCALEDIR'], |
97 [l.code]) | 97 [l.code]) |
98 translation[l.code] = t.gettext | 98 translation[l.code] = t.gettext |
99 except: | 99 except: |
100 if os.environ.has_key ('LYDOC_LOCALEDIR'): | 100 if 'LYDOC_LOCALEDIR' in os.environ: |
101 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') |
102 translation = dict ([(l.code, lambda x: x) for l in LANGUAGES]) | 102 translation = dict ([(l.code, lambda x: x) for l in LANGUAGES]) |
OLD | NEW |