Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1532)

Delta Between Two Patch Sets: python/langdefs.py

Issue 4951047: Uses langdefs.py to create language list for create-weblinks-itexi.py (Closed)
Left Patch Set: Further update to delete unneeded line Created 13 years, 6 months ago
Right Patch Set: Update to complete use of langdefs Created 13 years, 6 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Right: Side by side diff | Download
« no previous file with change/comment | « make/website.make ('k') | scripts/build/create-weblinks-itexi.py » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
(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
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])
LEFTRIGHT

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b