]>
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
46 f
= open('_wxlang.cpp', 'wt')
48 // This table is generated by misc/languages/genlang.py
49 // When making changes, please put them into misc/languages/langtabl.txt
52 #define SETWINLANG(info,lang,sublang) \\
53 info.WinLang = lang, info.WinSublang = sublang;
55 #define SETWINLANG(info,lang,sublang)
58 #define LNG(wxlang, canonical, winlang, winsublang, desc) \\
59 info.Language = wxlang; \\
60 info.CanonicalName = wxT(canonical); \\
61 info.Description = desc; \\
62 SETWINLANG(info, winlang, winsublang) \\
65 void wxLocale::InitLanguagesDB()
68 wxStringTokenizer tkn;
73 if ican
== '"-"': ican
= '""'
75 if ilang
== '-': ilang
= '0'
77 if isublang
== '-': isublang
= '0'
78 f
.write(' LNG(%-38s %-7s, %-15s, %-34s, %s)\n' % \
79 ((i
[0]+','), ican
, ilang
, isublang
, i
[4]))