]>
git.saurik.com Git - wxWidgets.git/blob - misc/languages/genlang.py
4 # Generates wxLanguage enum (to be cut&pasted to include/wx/intl.h)
5 # and convertion tables (ditto to src/common/intl.cpp)
12 f
= open('langtabl.txt')
13 for i
in f
.readlines():
15 table
.append((ispl
[0], ispl
[1], ispl
[2], ispl
[3], string
.join(ispl
[4:])))
21 f
= open('_wxlang.h', 'wt')
23 // This enum is generated by misc/languages/genlang.py
24 // When making changes, please put them into misc/languages/langtabl.txt
27 // user's default/preffered language as got from OS:
29 // unknown language, if wxLocale::GetSystemLanguage fails:
34 f
.write(' %s,\n' % i
[0])
36 // for custom, user-defined languages:
37 wxLANGUAGE_USER_DEFINED
44 f
= open('_wxlang.tex', 'wt')
46 %% This enum is generated by misc/languages/genlang.py
47 %% When making changes, please put them into misc/languages/langtabl.txt
48 \\begin{itemize}\\itemsep=0pt
49 \\item wxLANGUAGE_DEFAULT -- user's default language as obtained from the operating system
50 \\item wxLANGUAGE_UNKNOWN -- returned by \\helpref{GetSystemLanguage}{wxlocalegetsystemlanguage}
51 if it fails to detect the default language
52 \\item wxLANGUAGE_USER_DEFINED -- user defined languages' integer identifiers should start from
56 f
.write('\\item %s\n' % (i
[0].replace('_','\\_')))
57 f
.write("""\\end{itemize}
65 f
= open('_wxlang.cpp', 'wt')
67 // This table is generated by misc/languages/genlang.py
68 // When making changes, please put them into misc/languages/langtabl.txt
71 #define SETWINLANG(info,lang,sublang) \\
72 info.WinLang = lang, info.WinSublang = sublang;
74 #define SETWINLANG(info,lang,sublang)
77 #define LNG(wxlang, canonical, winlang, winsublang, desc) \\
78 info.Language = wxlang; \\
79 info.CanonicalName = wxT(canonical); \\
80 info.Description = desc; \\
81 SETWINLANG(info, winlang, winsublang) \\
84 void wxLocale::InitLanguagesDB()
87 wxStringTokenizer tkn;
92 if ican
== '"-"': ican
= '""'
94 if ilang
== '-': ilang
= '0'
96 if isublang
== '-': isublang
= '0'
97 f
.write(' LNG(%-38s %-7s, %-15s, %-34s, %s)\n' % \
98 ((i
[0]+','), ican
, ilang
, isublang
, i
[4]))