// --- --- --- generated code begins here --- --- ---
-// This enum is generated by misc/languages/genlang.py
-// When making changes, please put them into misc/languages/langtabl.txt
+/**
+ The languages supported by wxLocale.
+
+ This enum is generated by misc/languages/genlang.py
+ When making changes, please put them into misc/languages/langtabl.txt
+*/
enum wxLanguage
{
- // user's default/preffered language as got from OS:
- wxLANGUAGE_DEFAULT,
- // unknown language, if wxLocale::GetSystemLanguage fails:
- wxLANGUAGE_UNKNOWN,
-
+ /// User's default/preffered language as got from OS.
+ wxLANGUAGE_DEFAULT,
+
+ /// Unknown language, returned if wxLocale::GetSystemLanguage fails.
+ wxLANGUAGE_UNKNOWN,
+
""");
+ knownLangs = []
for i in table:
- f.write(' %s,\n' % i[0])
+ if i[0] not in knownLangs:
+ f.write(' %s,\n' % i[0])
+ knownLangs.append(i[0])
f.write("""
- // for custom, user-defined languages:
+ /// For custom, user-defined languages.
wxLANGUAGE_USER_DEFINED
};
f.close()
-def GenDocs(table):
- f = open('_wxlang.tex', 'wt')
- f.write("""
-
-%% --- --- --- generated code begins here --- --- ---
-
-%% This enum is generated by misc/languages/genlang.py
-%% When making changes, please put them into misc/languages/langtabl.txt
-\\begin{itemize}\\itemsep=0pt
-\\item wxLANGUAGE_DEFAULT -- user's default language as obtained from the operating system
-\\item wxLANGUAGE_UNKNOWN -- returned by \\helpref{GetSystemLanguage}{wxlocalegetsystemlanguage}
-if it fails to detect the default language
-\\item wxLANGUAGE_USER_DEFINED -- user defined languages' integer identifiers should start from
-this
-""");
- for i in table:
- f.write('\\item %s\n' % (i[0].replace('_','\\_')))
- f.write("""\\end{itemize}
-
-%% --- --- --- generated code ends here --- --- ---
-
-""")
- f.close()
-
-
-
-
def GenTable(table):
all_langs = []
all_sublangs = []
-
+
lngtable = ''
- ifdefs = ''
-
+ ifdefs = ''
+
for i in table:
ican = '"%s"' % i[1]
if ican == '"-"': ican = '""'
if s != '0':
ifdefs += '#ifndef %s\n#define %s (0)\n#endif\n' % (s, s)
for s in all_sublangs:
- if s != '0' and s != 'SUBLANG_DEFAULT':
+ if s != '0' and s != 'SUBLANG_DEFAULT':
ifdefs += '#ifndef %s\n#define %s SUBLANG_DEFAULT\n#endif\n' % (s, s)
f = open('_wxlang.cpp', 'wt')
// This table is generated by misc/languages/genlang.py
// When making changes, please put them into misc/languages/langtabl.txt
-#ifndef __WIN32__
+#if !defined(__WIN32__) || defined(__WXMICROWIN__)
#define SETWINLANG(info,lang,sublang)
wxLanguageInfo info;
wxStringTokenizer tkn;
- %s
-};
+%s
+}
#undef LNG
// --- --- --- generated code ends here --- --- ---
table = ReadTable()
-GenEnum(table)
+GenEnum(table) # the enum is used also (thanks to doxygen) in the docs
GenTable(table)
-GenDocs(table)