Improve generated process for the language database files
Fix some issues and streamline regeneration process: - A few glitches (like duplicate language symbols, wrong Windows language ids etc) were fixed. - Scripts were added to allow to regenerate the list of supported locales from the list of known Windows locales. - Version info when language symbols became available was added to the documentation of the language symbol enum. - Synonyms are no longer hard-coded in the script genlang.py. See #23453. Closes #23437.
This commit is contained in:
parent
b07a77cbf9
commit
a20aa4de75
22 changed files with 2659 additions and 1699 deletions
|
|
@ -21,14 +21,14 @@
|
|||
// wxLanguage: defines all supported languages
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// --- --- --- generated code begins here --- --- ---
|
||||
|
||||
/**
|
||||
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
|
||||
*/
|
||||
// --- --- --- generated code begins here --- --- ---
|
||||
|
||||
enum wxLanguage
|
||||
{
|
||||
/// User's default/preferred language as got from OS.
|
||||
|
|
@ -152,7 +152,8 @@ enum wxLanguage
|
|||
wxLANGUAGE_CENTRAL_ATLAS_TAMAZIGHT_TIFINAGH,
|
||||
wxLANGUAGE_CENTRAL_ATLAS_TAMAZIGHT_TIFINAGH_MOROCCO,
|
||||
wxLANGUAGE_CENTRAL_KURDISH,
|
||||
wxLANGUAGE_CENTRAL_KURDISH_IRAQ,
|
||||
wxLANGUAGE_CENTRAL_KURDISH_ARABIC,
|
||||
wxLANGUAGE_CENTRAL_KURDISH_ARABIC_IRAQ,
|
||||
wxLANGUAGE_CHAKMA,
|
||||
wxLANGUAGE_CHAKMA_CHAKMA,
|
||||
wxLANGUAGE_CHAKMA_CHAKMA_BANGLADESH,
|
||||
|
|
@ -333,7 +334,6 @@ enum wxLanguage
|
|||
wxLANGUAGE_FAEROESE,
|
||||
wxLANGUAGE_FAEROESE_DENMARK,
|
||||
wxLANGUAGE_FAEROESE_FAROE_ISLANDS,
|
||||
wxLANGUAGE_FARSI,
|
||||
wxLANGUAGE_FIJI,
|
||||
wxLANGUAGE_FILIPINO,
|
||||
wxLANGUAGE_FILIPINO_PHILIPPINES,
|
||||
|
|
@ -435,7 +435,6 @@ enum wxLanguage
|
|||
wxLANGUAGE_GREEK,
|
||||
wxLANGUAGE_GREEK_CYPRUS,
|
||||
wxLANGUAGE_GREEK_GREECE,
|
||||
wxLANGUAGE_GREENLANDIC,
|
||||
wxLANGUAGE_GUARANI,
|
||||
wxLANGUAGE_GUARANI_PARAGUAY,
|
||||
wxLANGUAGE_GUJARATI,
|
||||
|
|
@ -483,9 +482,10 @@ enum wxLanguage
|
|||
wxLANGUAGE_JAPANESE,
|
||||
wxLANGUAGE_JAPANESE_JAPAN,
|
||||
wxLANGUAGE_JAVANESE,
|
||||
wxLANGUAGE_JAVANESE_INDONESIA,
|
||||
wxLANGUAGE_JAVANESE_JAVANESE,
|
||||
wxLANGUAGE_JAVANESE_JAVANESE_INDONESIA,
|
||||
wxLANGUAGE_JAVANESE_LATIN,
|
||||
wxLANGUAGE_JAVANESE_LATIN_INDONESIA,
|
||||
wxLANGUAGE_JOLA_FONYI,
|
||||
wxLANGUAGE_JOLA_FONYI_SENEGAL,
|
||||
wxLANGUAGE_KABUVERDIANU,
|
||||
|
|
@ -495,6 +495,7 @@ enum wxLanguage
|
|||
wxLANGUAGE_KAKO,
|
||||
wxLANGUAGE_KAKO_CAMEROON,
|
||||
wxLANGUAGE_KALAALLISUT,
|
||||
wxLANGUAGE_KALAALLISUT_GREENLAND,
|
||||
wxLANGUAGE_KALENJIN,
|
||||
wxLANGUAGE_KALENJIN_KENYA,
|
||||
wxLANGUAGE_KAMBA,
|
||||
|
|
@ -668,6 +669,7 @@ enum wxLanguage
|
|||
wxLANGUAGE_PASHTO,
|
||||
wxLANGUAGE_PASHTO_AFGHANISTAN,
|
||||
wxLANGUAGE_PASHTO_PAKISTAN,
|
||||
wxLANGUAGE_PERSIAN,
|
||||
wxLANGUAGE_PERSIAN_IRAN,
|
||||
wxLANGUAGE_POLISH,
|
||||
wxLANGUAGE_POLISH_POLAND,
|
||||
|
|
@ -956,23 +958,23 @@ enum wxLanguage
|
|||
wxLANGUAGE_BENGALI_BANGLADESH = wxLANGUAGE_BANGLA_BANGLADESH,
|
||||
wxLANGUAGE_BENGALI_INDIA = wxLANGUAGE_BANGLA_INDIA,
|
||||
wxLANGUAGE_BHUTANI = wxLANGUAGE_DZONGKHA,
|
||||
wxLANGUAGE_CAMBODIAN = wxLANGUAGE_KHMER,
|
||||
wxLANGUAGE_CHINESE_MACAU = wxLANGUAGE_CHINESE_MACAO,
|
||||
wxLANGUAGE_CHINESE_SIMPLIFIED = wxLANGUAGE_CHINESE_CHINA,
|
||||
wxLANGUAGE_CHINESE_TRADITIONAL = wxLANGUAGE_CHINESE_TAIWAN,
|
||||
wxLANGUAGE_CHINESE_MACAU = wxLANGUAGE_CHINESE_MACAO,
|
||||
wxLANGUAGE_FARSI = wxLANGUAGE_PERSIAN,
|
||||
wxLANGUAGE_GREENLANDIC = wxLANGUAGE_KALAALLISUT_GREENLAND,
|
||||
wxLANGUAGE_KANURI_NIGERIA = wxLANGUAGE_KANURI_LATIN_NIGERIA,
|
||||
wxLANGUAGE_KASHMIRI_PERSO_ARABIC = wxLANGUAGE_KASHMIRI_ARABIC,
|
||||
wxLANGUAGE_KASHMIRI_PERSO_ARABIC_INDIA = wxLANGUAGE_KASHMIRI_ARABIC_INDIA,
|
||||
wxLANGUAGE_KERNEWEK = wxLANGUAGE_CORNISH,
|
||||
wxLANGUAGE_KURDISH_PERSO_ARABIC_IRAN = wxLANGUAGE_KURDISH_ARABIC_IRAN,
|
||||
wxLANGUAGE_KURDISH_PERSO_ARABIC_IRAN = wxLANGUAGE_KURDISH_ARABIC_IRAN,
|
||||
wxLANGUAGE_MALAY_BRUNEI_DARUSSALAM = wxLANGUAGE_MALAY_BRUNEI,
|
||||
wxLANGUAGE_ORIYA = wxLANGUAGE_ODIA,
|
||||
wxLANGUAGE_ORIYA_INDIA = wxLANGUAGE_ODIA_INDIA,
|
||||
wxLANGUAGE_SPANISH_MODERN = wxLANGUAGE_SPANISH,
|
||||
wxLANGUAGE_UZBEK_PERSO_ARABIC = wxLANGUAGE_UZBEK_ARABIC,
|
||||
wxLANGUAGE_UZBEK_PERSO_ARABIC_AFGHANISTAN = wxLANGUAGE_UZBEK_ARABIC_AFGHANISTAN,
|
||||
|
||||
/// Obsolete synonym.
|
||||
wxLANGUAGE_CAMBODIAN = wxLANGUAGE_KHMER
|
||||
};
|
||||
|
||||
// --- --- --- generated code ends here --- --- ---
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -1,12 +1,13 @@
|
|||
Run the genlang.py script from the top level wxWidgets directory to
|
||||
update include/wx/language.h (wxLanguage enum), interface/wx/language.h
|
||||
(its documentation) and src/common/languageinfo.cpp (conversion tables)
|
||||
with the data from langtabl.txt and scripttabl.txt.
|
||||
with the data from langtabl.txt, synonymtabl.txt, and scripttabl.txt.
|
||||
|
||||
langtabl.txt contains a tabular list of language entries. Each entry
|
||||
contains
|
||||
|
||||
- a symbolic language identifier used in enum wxLanguage,
|
||||
- a wxWidgets version when the entry was first introduced (a hyphen if not known)
|
||||
- a BCP 47-like locale identifier,
|
||||
- a Unix locale identifier,
|
||||
- a Unix locale identifier including a region id (if the default Unix
|
||||
|
|
@ -24,5 +25,70 @@ to convert between script code used in BCP 47-like identifiers and
|
|||
script modifiers used in Unix locale names. The data in (2) can be used
|
||||
to update scripttabl.txt if necessary.
|
||||
|
||||
synonymtabl.txt contains a list of aliases for symbolic language identifiers.
|
||||
This list is used to generate specific entries in wxLanguage enumeration.
|
||||
|
||||
Note: None of the files langtabl.txt, synonymtabl.txt, and scripttabl.txt should be
|
||||
edited manually. Instead these files should be regenerated under Windows 11 or
|
||||
above.
|
||||
|
||||
Windows provides an extensive list of locales. This list is used to regenerate
|
||||
the files langtabl.txt, synonymtabl.txt, and scripttabl.txt. The subdirectory
|
||||
util contains the C source of a small utility application that queries Windows
|
||||
for a list of known locales.
|
||||
|
||||
2 additional tools are required to perform the regeneration process:
|
||||
|
||||
1) SQLite3 shell
|
||||
Precompiled binaries can be downloaded from https://www.sqlite.org/download.html.
|
||||
The download link is under the heading "Precompiled Binaries for Windows" and
|
||||
looks like "sqlite-tools-win32-x86-3xxyyzz.zip" (where xx, yy, zz denote the
|
||||
current SQLite version). Alternatively, the SQLite shell can be compiled from
|
||||
sources - the archive "sqlite-amalgamation-3xxyyzz.zip" contains the required
|
||||
source files.
|
||||
|
||||
2) Lua shell
|
||||
Precompiled binaries are available at https://luabinaries.sourceforge.net/.
|
||||
Download lua-x.y.z_Win32_bin.zip or lua-x.y.z_Win64_bin.zip (where x, y, z denotes
|
||||
the lua version) from the download page. Rename the executable luaxy.exe to
|
||||
luashell.exe or adjust the batch file mklangtablnew.bat accordingly.
|
||||
|
||||
The regeneration process consists of the following steps:
|
||||
|
||||
1) Regenerate the list of known Windows locales (optional)
|
||||
This step is usually only required when a new major Windows version is published.
|
||||
The utility showlocales should be invoked from a command prompt as follows:
|
||||
|
||||
showlocales > win-locale-table-win.txt
|
||||
|
||||
The resulting file win-locale-table-win.txt has to be placed into subdirectory
|
||||
data/windows.
|
||||
|
||||
2) Update the Unicode data files (optional)
|
||||
This step is only required when the Unicode data were actually updated.
|
||||
To perform this step execute the batch file getunicodefiles.bat, located in the
|
||||
data subdirectory.
|
||||
|
||||
3) Regenerate langtabl.txt, synonymtabl.txt, and scripttabl.txt
|
||||
To perform this step execute the batch file mklangtablnew.bat, located in the
|
||||
data subdirectory. The new versions will be placed in the data directory.
|
||||
|
||||
4) Check resulting new files langtabl.txt, synonymtabl.txt, and scripttabl.txt
|
||||
The messages from step 3 issued by the batch file and the resulting files should
|
||||
be carefully checked. If no errors occurred, the batch file replacetables.bat
|
||||
can be executed.
|
||||
|
||||
5) Run the Python script genlang.py from the top level wxWidgets directory.
|
||||
|
||||
6) Commit the changes.
|
||||
|
||||
Notes:
|
||||
1) Do not perform the regeneration process for older wxWidgets versions.
|
||||
The scripts expect the data table files in a new format that was first introduced
|
||||
in version 3.3.0.
|
||||
2) If you need to add locales not present in the list of known Windows locales, then
|
||||
they should be added at the end of the script win_genlocaletable.lua.
|
||||
|
||||
Footnotes
|
||||
(1) used on Windows only, deprecated by Microsoft
|
||||
(2) http://www.unicode.org/iso15924/iso15924-codes.html
|
||||
|
|
|
|||
12
misc/languages/data/.gitignore
vendored
Normal file
12
misc/languages/data/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
# Ignore temporary files that are generated in course of
|
||||
# regenerating the lists of known languages, scripts, and synonyms
|
||||
|
||||
# exclude database and data files
|
||||
*.db3
|
||||
*.txt
|
||||
|
||||
# exclude everything in temp
|
||||
temp/*
|
||||
|
||||
# exception to the rule
|
||||
!temp/.gitkeep
|
||||
14
misc/languages/data/getunicodefiles.bat
Normal file
14
misc/languages/data/getunicodefiles.bat
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
rem Download files from Unicode Org
|
||||
|
||||
rem Retrieve working directory
|
||||
set "workdir=%cd%"
|
||||
|
||||
rem Create backup copies
|
||||
copy unicode\iso15924.txt unicode\iso15924.txt.bak
|
||||
copy unicode\territory_codes.txt unicode\territory_codes.txt.bak
|
||||
|
||||
rem Download ISO 15924 (list of scripts)
|
||||
bitsadmin /transfer wxDownloadJob /download /priority normal https://www.unicode.org/iso15924/iso15924.txt %workdir%\unicode\iso15924.txt
|
||||
|
||||
rem Download ISO 3166 (list of territories)
|
||||
bitsadmin /transfer wxDownloadJob /download /priority normal https://github.com/unicode-org/cldr/raw/main/tools/cldr-code/src/main/resources/org/unicode/cldr/util/data/territory_codes.txt %workdir%\unicode\territory_codes.txt
|
||||
20
misc/languages/data/mkdatabase.sql
Normal file
20
misc/languages/data/mkdatabase.sql
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
.print Initialize database
|
||||
.print Import territory codes
|
||||
.read temp/uni_loadterritorycodes.sql
|
||||
|
||||
.print Import locales supported by Windows
|
||||
.read temp/win_loadlocaletable.sql
|
||||
|
||||
.print Import wxWidgets language list
|
||||
.read temp/wx_loadlangtabl.sql
|
||||
|
||||
.print Import wxWidgets language synonyms
|
||||
.read temp/wx_loadsynonymtabl.sql
|
||||
|
||||
.print Import script map
|
||||
.read temp/uni_loadscriptmap.sql
|
||||
|
||||
.read temp/wx_loadversion.sql
|
||||
|
||||
.print Generate new tables (langtabl, scripttabl, synonymtabl)
|
||||
.read mkwxtables.sql
|
||||
25
misc/languages/data/mklangtablnew.bat
Normal file
25
misc/languages/data/mklangtablnew.bat
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
rem Batch script to regenerate the list of known locales
|
||||
|
||||
rem Create a copy of the current lists
|
||||
copy ..\langtabl.txt temp\langtabl_current.txt
|
||||
copy ..\scripttabl.txt temp\scripttabl_current.txt
|
||||
copy ..\synonymtabl.txt temp\synonymtabl_current.txt
|
||||
|
||||
rem Generate lists based on Unicode data
|
||||
luashell unicode\uni_territorycodes.lua
|
||||
luashell unicode\uni_genscriptmap.lua
|
||||
|
||||
rem Generate list of locales based on known Windows locales
|
||||
luashell windows\win_genlocaletable.lua
|
||||
|
||||
rem Generate lists based on current wxWidgets data
|
||||
rem Extract current wxWidgets version
|
||||
luashell wx\wx_readversion.lua
|
||||
rem Load current version of langtabl.txt
|
||||
luashell wx\wx_loadlangtabl.lua
|
||||
rem Load list of current synonyms
|
||||
luashell wx\wx_loadsynonymtabl.lua
|
||||
|
||||
rem Generate locale data database
|
||||
del localedata.db3
|
||||
sqlite3 localedata.db3 ".read mkdatabase.sql"
|
||||
88
misc/languages/data/mkwxtables.sql
Normal file
88
misc/languages/data/mkwxtables.sql
Normal file
|
|
@ -0,0 +1,88 @@
|
|||
-- Create unique wx language mapping
|
||||
create table if not exists wx_langmapuni (wxlangname char, wxlangid char, wxlocregion char, primary key (wxlangname));
|
||||
delete from wx_langmapuni;
|
||||
insert into wx_langmapuni select wxlangname, wxlangid, wxlocregion from wx_langmap;
|
||||
|
||||
-- Create mapping between wx and Windows ids
|
||||
create table if not exists wx2winmapping (wxlocidnew char, wxnamenew char, wxlocidold char, wxnameold char, primary key (wxlocidnew));
|
||||
delete from wx2winmapping;
|
||||
|
||||
insert into wx2winmapping select wt.wxlocid, wt.wxname, ifnull(wm.wxlangid,'-'), ifnull(wm.wxlangname,'-') from win_localetable wt
|
||||
left join wx_langmapuni wm on wt.wxlocid=wm.wxlangid;
|
||||
|
||||
update wx2winmapping set wxlocidold = ifnull((select wxlangid from wx_langmapuni where wx_langmapuni.wxlangname=wx2winmapping.wxnamenew),'-') where wx2winmapping.wxlocidold='-';
|
||||
|
||||
-- Create mapping between language and country
|
||||
create table if not exists lang2iso2 (lang char, iso2 char, wintag char, primary key (lang));
|
||||
delete from lang2iso2;
|
||||
insert into lang2iso2 select w.locid, w.locid||'_'||c.iso2, w.locid||'-'||c.iso2 from win_localetable w, uni_territorycodes c where w.locid not like '%-%' and w.country3=c.iso3;
|
||||
|
||||
-- Perform checks
|
||||
.output temp/wxmissing.log
|
||||
select '*** Missing via wx_langmapuni';
|
||||
select wxlangname, wxlangid from wx_langmapuni where not exists (select wxnameold from wx2winmapping where wxnameold=wxlangname);
|
||||
select '*** Missing via wx_langmap';
|
||||
select wxlangname, wxlangid from wx_langmap where not exists (select wxname from win_localetable where wxname=wxlangname);
|
||||
.output stdout
|
||||
|
||||
select ' #missing wxlangmapuni =', count(wxlangname) from wx_langmapuni where not exists (select wxnameold from wx2winmapping where wxnameold=wxlangname);
|
||||
select ' #matched wxlangmapuni =', count(wxlangname) from wx_langmapuni where exists (select wxnameold from wx2winmapping where wxnameold=wxlangname);
|
||||
select ' #matched wx2win =', count(distinct wxnameold) from wx2winmapping where wxnameold <> '-';
|
||||
|
||||
select ' #missing wxlangmap =', count(wxlangname) from wx_langmap where not exists (select wxname from win_localetable where wxname=wxlangname) and not exists (select wxnamesyn from wx_synonyms where wxnamesyn=wxlangname);
|
||||
select wxlangname from wx_langmap where not exists (select wxname from win_localetable where wxname=wxlangname) and not exists (select wxnamesyn from wx_synonyms where wxnamesyn=wxlangname);
|
||||
|
||||
select wxname from win_localetable where exists (select wxnamesyn from wx_synonyms where wxnamesyn = win_localetable.wxname);
|
||||
|
||||
-- Generate references to previous wx mappings
|
||||
update win_localetable set (wxlocidold, wxnameold) =
|
||||
(select wxlocregion, wxlangname from wx_langmap m1 where m1.wxlangid=win_localetable.wxlocid);
|
||||
|
||||
-- Replace NULL values with strings ('-')
|
||||
update win_localetable set wxlocidold = '-' where wxlocidold is null;
|
||||
update win_localetable set wxnameold = '-' where wxnameold is null;
|
||||
|
||||
-- Adjust Windows language ids
|
||||
--.changes on
|
||||
update win_localetable as t1 set (idlang,idsublang) =
|
||||
(t2.idlang, t2.idsublang) from win_localetable t2
|
||||
where t1.wxlocid <> '-' and t2.wxlocid = t1.wxlocidold and (t1.idlang <> t2.idlang or t1.idsublang <> t2.idsublang);
|
||||
--.changes off
|
||||
|
||||
-- Adjust canonical reference for language-only entries
|
||||
update win_localetable as w1 set wxlocidold =
|
||||
(select m.iso2 from win_localetable w, lang2iso2 m
|
||||
where w.locid=w1.locid and w.locid=m.lang
|
||||
and exists (select 1 from win_localetable w2 where w2.locid=m.wintag))
|
||||
where w1.locid not like '%-%' and (w1.wxlocidold='-' or w1.wxlocidold is null);
|
||||
|
||||
update win_localetable set wxlocidold = '-' where wxlocidold is null;
|
||||
|
||||
-- Initialize parameter holding the current wx version
|
||||
.parameter init
|
||||
.print Set wx version parameter
|
||||
.parameter set @wxversion "(select version from wx_version)"
|
||||
.parameter list
|
||||
|
||||
-- Generate new list of languages
|
||||
.output langtabl.txt
|
||||
select printf('%-55s %-9s %-14s %-25s %-14s %-4s %-4s %s "%s","%s"',
|
||||
w.wxname, ifnull(x.wxversion,@wxversion), w.locid, w.wxlocid, w.wxlocidold,
|
||||
w.idlang, w.idsublang, w.layout, w.englishdisplay, w.nativedisplayhex)
|
||||
from win_localetable w left join wx_langmap x on w.wxlocid = x.wxlangid order by w.wxname;
|
||||
.output stdout
|
||||
|
||||
-- Generate new list of script mappings
|
||||
.output scripttabl.txt
|
||||
select printf('%-4s %s', sctag, lower(scalias)) from uni_scriptmap where scalias <> '-' order by sctag;
|
||||
.output stdout
|
||||
|
||||
-- Generate new list of wxLANGUAGE synonyms
|
||||
insert into wx_synonyms
|
||||
select wl.wxnameold, wl.wxname, wl.locid, ifnull(wm.wxversion,@wxversion)
|
||||
from win_localetable wl left join wx_langmap wm on wl.wxnameold = wm.wxlangname
|
||||
where wl.wxnameold <> '-' and wl.wxname <> wl.wxnameold;
|
||||
delete from wx_synonyms where wxnamesyn in (select wxname from win_localetable);
|
||||
.output synonymtabl.txt
|
||||
select printf('%-55s %-55s %-14s %s', wxnamesyn, wxnameprim, winlocid, wxversion) from wx_synonyms order by wxnamesyn;
|
||||
.output stdout
|
||||
6
misc/languages/data/replacetables.bat
Normal file
6
misc/languages/data/replacetables.bat
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
rem Batch script to replace the data tables by new versions
|
||||
|
||||
rem Replace previous versions with new versions
|
||||
copy langtabl.txt ..\langtabl_current.txt
|
||||
copy scripttabl.txt ..\scripttabl_current.txt
|
||||
copy synonymtabl.txt ..\synonymtabl_current.txt
|
||||
0
misc/languages/data/temp/.gitkeep
Normal file
0
misc/languages/data/temp/.gitkeep
Normal file
58
misc/languages/data/unicode/uni_genscriptmap.lua
Normal file
58
misc/languages/data/unicode/uni_genscriptmap.lua
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
-- Generate a script map based on ISO 15924 data
|
||||
--
|
||||
-- Data source: Unicode
|
||||
-- URL: https://www.unicode.org/iso15924/iso15924.txt
|
||||
-- License: UNICODE, INC. LICENSE AGREEMENT - DATA FILES AND SOFTWARE
|
||||
|
||||
codeFileName = "unicode/iso15924.txt"
|
||||
|
||||
function split(str, character)
|
||||
result = {}
|
||||
|
||||
index = 1
|
||||
for s in string.gmatch(str .. character, "(.-)"..character) do
|
||||
result[index] = s
|
||||
index = index + 1
|
||||
end
|
||||
|
||||
return result
|
||||
end
|
||||
|
||||
fo2 = io.open('temp/uni_loadscriptmap.sql','w')
|
||||
fo2:write('-- Mapping of script codes based on ISO 15924\n-- Date: ' .. os.date("%Y-%m-%d %H:%M") .. '\n\n')
|
||||
fo2:write('-- Data source: Unicode Org (https://www.unicode.org)\n')
|
||||
fo2:write('-- URL: https://www.unicode.org/iso15924/iso15924.txt\n')
|
||||
fo2:write('-- License: UNICODE, INC. LICENSE AGREEMENT - DATA FILES AND SOFTWARE\n\n')
|
||||
|
||||
fo2:write("create table if not exists uni_scriptmap (sctag char, scname char, scalias char, primary key (sctag));\n")
|
||||
fo2:write('delete from uni_scriptmap;\nbegin;\n')
|
||||
|
||||
-- Names and order of data columns
|
||||
-- Code|N°|English Name|Nom français|Alias|Age|Date
|
||||
|
||||
count = 0
|
||||
for line in io.lines(codeFileName) do
|
||||
rem = string.sub(line,1,1)
|
||||
if rem ~= "#" and rem ~= "" then
|
||||
values = split(line, ";")
|
||||
sctag = values[1]
|
||||
scnum = values[2]
|
||||
scname = values[3]
|
||||
scname_fr = values[4]
|
||||
scalias = values[5]
|
||||
scage = values[6]
|
||||
scdate = values[7]
|
||||
|
||||
scname = scname:gsub("'", "''")
|
||||
if scalias == "" then
|
||||
scalias = "-"
|
||||
end
|
||||
|
||||
fo2:write("insert into uni_scriptmap values ('" .. sctag .. "', '" .. scname .. "', '" .. scalias .. "');\n")
|
||||
count = count + 1
|
||||
end
|
||||
end
|
||||
print("Number of script mappings=" .. count)
|
||||
|
||||
fo2:write('commit;\n')
|
||||
fo2:close()
|
||||
61
misc/languages/data/unicode/uni_territorycodes.lua
Normal file
61
misc/languages/data/unicode/uni_territorycodes.lua
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
-- Generate a script map based on ISO 15924 data
|
||||
--
|
||||
-- Data source: Unicode CLDR
|
||||
-- URL: https://github.com/unicode-org/cldr/raw/main/tools/cldr-code/src/main/resources/org/unicode/cldr/util/data/territory_codes.txt
|
||||
-- License: UNICODE, INC. LICENSE AGREEMENT - DATA FILES AND SOFTWARE
|
||||
|
||||
codeFileName = "unicode/territory_codes.txt"
|
||||
|
||||
function split(str)
|
||||
result = {}
|
||||
|
||||
index = 1
|
||||
for s in string.gmatch(str, "%S+") do
|
||||
result[index] = s
|
||||
index = index + 1
|
||||
end
|
||||
|
||||
return result
|
||||
end
|
||||
|
||||
fo1 = io.open('temp/uni_loadterritorycodes.sql','w')
|
||||
fo1:write('-- List of territory codes based on ISO 3166\n-- Date: ' .. os.date("%Y-%m-%d %H:%M") .. '\n\n')
|
||||
fo1:write('-- Data source: Unicode CLDR (https://cldr.unicode.org)\n')
|
||||
fo1:write('-- File: https://github.com/unicode-org/cldr/raw/main/tools/cldr-code/src/main/resources/org/unicode/cldr/util/data/territory_codes.txt\n')
|
||||
fo1:write('-- License: UNICODE, INC. LICENSE AGREEMENT - DATA FILES AND SOFTWARE\n\n')
|
||||
|
||||
fo1:write("create table if not exists uni_territorycodes (iso2 char, iso3 char, primary key (iso2));\n")
|
||||
fo1:write('delete from uni_territorycodes;\nbegin;\n')
|
||||
|
||||
count = 0
|
||||
ccprev = ""
|
||||
for line in io.lines(codeFileName) do
|
||||
rem = string.sub(line,1,1)
|
||||
if rem ~= "#" then
|
||||
values = split(line)
|
||||
|
||||
-- 1 RFC3066
|
||||
-- 2 UN Numeric
|
||||
-- 3 ISO3166 Alpha-3
|
||||
-- 4 internet
|
||||
-- 5 FIPS-10
|
||||
|
||||
iso2 = values[1]
|
||||
iso3 = values[3]
|
||||
|
||||
if iso3 ~= nil then
|
||||
fo1:write("insert into uni_territorycodes values ('" .. iso2 .. "', '" .. iso3 .. "');\n")
|
||||
else
|
||||
print('*** Warning: no iso3 code for ' .. iso2)
|
||||
end
|
||||
count = count + 1
|
||||
else
|
||||
if line == "# Deprecated codes" then
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
print("Number of countries=" .. count)
|
||||
|
||||
fo1:write('commit;\n')
|
||||
fo1:close()
|
||||
380
misc/languages/data/windows/win_genlocaletable.lua
Normal file
380
misc/languages/data/windows/win_genlocaletable.lua
Normal file
|
|
@ -0,0 +1,380 @@
|
|||
-- Assign script arguments and check validity
|
||||
-- Data source:
|
||||
-- File generated by utility app from Windows data
|
||||
codeFileName = "windows/win-locale-table-win.txt"
|
||||
|
||||
function scriptmap()
|
||||
-- mapping script id to script name
|
||||
-- needs to be updated manually, if new scripts are encountered
|
||||
return {
|
||||
["Arab"] = "arabic",
|
||||
["Adlm"] = "adlam",
|
||||
["Beng"] = "bengali",
|
||||
["Cakm"] = "chakma",
|
||||
["Cans"] = "canadian_aboriginal",
|
||||
["Cher"] = "cherokee",
|
||||
["Cyrl"] = "cyrillic",
|
||||
["Deva"] = "devanagari",
|
||||
["Guru"] = "gurmukhi",
|
||||
["Java"] = "javanese",
|
||||
["Latn"] = "latin",
|
||||
["Mong"] = "mongolian",
|
||||
["Olck"] = "ol_chiki",
|
||||
["Tfng"] = "tifinagh",
|
||||
["Vaii"] = "vai"
|
||||
}
|
||||
end
|
||||
|
||||
function initmap()
|
||||
-- mapping locale id to wx language identifier
|
||||
return {
|
||||
["ar_AE"] = "wxLANGUAGE_ARABIC_UAE",
|
||||
["bn_IN"] = "wxLANGUAGE_BANGLA_INDIA",
|
||||
["ca_ES@valencia"] = "wxLANGUAGE_VALENCIAN",
|
||||
["chr@cherokee"] = "wxLANGUAGE_CHEROKEE_CHEROKEE",
|
||||
["chr_US@cherokee"] = "wxLANGUAGE_CHEROKEE_US",
|
||||
["cy_GB"] = "wxLANGUAGE_WELSH_UK",
|
||||
["de_AT"] = "wxLANGUAGE_GERMAN_AUSTRIAN",
|
||||
["de_CH"] = "wxLANGUAGE_GERMAN_SWISS",
|
||||
["en_IE"] = "wxLANGUAGE_ENGLISH_EIRE",
|
||||
["en_TT"] = "wxLANGUAGE_ENGLISH_TRINIDAD",
|
||||
["en_GB"] = "wxLANGUAGE_ENGLISH_UK",
|
||||
["en_US"] = "wxLANGUAGE_ENGLISH_US",
|
||||
["es_MX"] = "wxLANGUAGE_SPANISH_MEXICAN",
|
||||
["es_US"] = "wxLANGUAGE_SPANISH_US",
|
||||
["ff"] = "wxLANGUAGE_FULAH",
|
||||
["fo"] = "wxLANGUAGE_FAEROESE",
|
||||
["fo_DK"] = "wxLANGUAGE_FAEROESE_DENMARK",
|
||||
["fo_FO"] = "wxLANGUAGE_FAEROESE_FAROE_ISLANDS",
|
||||
["fr_BE"] = "wxLANGUAGE_FRENCH_BELGIAN",
|
||||
["fr_CA"] = "wxLANGUAGE_FRENCH_CANADIAN",
|
||||
["fr_CH"] = "wxLANGUAGE_FRENCH_SWISS",
|
||||
["fy"] = "wxLANGUAGE_FRISIAN",
|
||||
["fy_NL"] = "wxLANGUAGE_FRISIAN_NETHERLANDS",
|
||||
["gd"] = "wxLANGUAGE_SCOTS_GAELIC",
|
||||
["gd_GB"] = "wxLANGUAGE_SCOTS_GAELIC_UK",
|
||||
["haw_US"] = "wxLANGUAGE_HAWAIIAN_US",
|
||||
["it_CH"] = "wxLANGUAGE_ITALIAN_SWISS",
|
||||
["jv@latin"] = "wxLANGUAGE_JAVANESE_LATIN",
|
||||
["jv_ID@latin"] = "wxLANGUAGE_JAVANESE_LATIN_INDONESIA",
|
||||
["kr"] = "wxLANGUAGE_KANURI",
|
||||
["ku@arabic"] = "wxLANGUAGE_CENTRAL_KURDISH_ARABIC",
|
||||
["ku_IQ@arabic"] = "wxLANGUAGE_CENTRAL_KURDISH_ARABIC_IRAQ",
|
||||
["kw_GB"] = "wxLANGUAGE_CORNISH_UK",
|
||||
["ky"] = "wxLANGUAGE_KIRGHIZ",
|
||||
["ky_KG"] = "wxLANGUAGE_KIRGHIZ_KYRGYZSTAN",
|
||||
["lkt_US"] = "wxLANGUAGE_LAKOTA_US",
|
||||
["lo"] = "wxLANGUAGE_LAOTHIAN",
|
||||
["lo_LA"] = "wxLANGUAGE_LAOTHIAN_LAOS",
|
||||
["mni"] = "wxLANGUAGE_MANIPURI",
|
||||
["mni@bengali"] = "wxLANGUAGE_MANIPURI_BENGALI",
|
||||
["mni_IN"] = "wxLANGUAGE_MANIPURI_INDIA",
|
||||
["mn@cyrillic"] = "wxLANGUAGE_MONGOLIAN_CYRILLIC",
|
||||
["mn@mongolian"] = "wxLANGUAGE_MONGOLIAN_TRADITIONAL",
|
||||
["mn_CN@mongolian"] = "wxLANGUAGE_MONGOLIAN_TRADITIONAL_CHINA",
|
||||
["mn_MN@mongolian"] = "wxLANGUAGE_MONGOLIAN_TRADITIONAL_MONGOLIA",
|
||||
["nl_BE"] = "wxLANGUAGE_DUTCH_BELGIAN",
|
||||
["pa@arabic"] = "wxLANGUAGE_PUNJABI_ARABIC",
|
||||
["pa@gurmukhi"] = "wxLANGUAGE_PUNJABI_GURMUKHI",
|
||||
["pt_BR"] = "wxLANGUAGE_PORTUGUESE_BRAZILIAN",
|
||||
["quc@latin"] = "wxLANGUAGE_KICHE_LATIN",
|
||||
["rm"] = "wxLANGUAGE_RHAETO_ROMANCE",
|
||||
["rm_CH"] = "wxLANGUAGE_RHAETO_ROMANCE_SWITZERLAND",
|
||||
["rn"] = "wxLANGUAGE_KIRUNDI",
|
||||
["rn_BI"] = "wxLANGUAGE_KIRUNDI_BURUNDI",
|
||||
["sd@arabic"] = "wxLANGUAGE_SINDHI_ARABIC",
|
||||
["se"] = "wxLANGUAGE_SAMI",
|
||||
["se_FI"] = "wxLANGUAGE_SAMI_FINLAND",
|
||||
["se_NO"] = "wxLANGUAGE_SAMI_NORWAY",
|
||||
["se_SE"] = "wxLANGUAGE_SAMI_SWEDEN",
|
||||
["sg"] = "wxLANGUAGE_SANGHO",
|
||||
["sg_CF"] = "wxLANGUAGE_SANGHO_CENTRAL_AFRICAN_REPUBLIC",
|
||||
["si"] = "wxLANGUAGE_SINHALESE",
|
||||
["si_LK"] = "wxLANGUAGE_SINHALESE_SRI_LANKA",
|
||||
["sw"] = "wxLANGUAGE_SWAHILI",
|
||||
["sw_CD"] = "wxLANGUAGE_SWAHILI_CONGO_DRC",
|
||||
["sw_KE"] = "wxLANGUAGE_SWAHILI_KENYA",
|
||||
["sw_TZ"] = "wxLANGUAGE_SWAHILI_TANZANIA",
|
||||
["sw_UG"] = "wxLANGUAGE_SWAHILI_UGANDA",
|
||||
["to"] = "wxLANGUAGE_TONGA",
|
||||
["to_TO"] = "wxLANGUAGE_TONGA_TONGA",
|
||||
["ts"] = "wxLANGUAGE_TSONGA",
|
||||
["ts_ZA"] = "wxLANGUAGE_TSONGA_SOUTH_AFRICA",
|
||||
["ug"] = "wxLANGUAGE_UIGHUR",
|
||||
["ug_CN"] = "wxLANGUAGE_UIGHUR_CHINA",
|
||||
["xh"] = "wxLANGUAGE_XHOSA",
|
||||
["xh_ZA"] = "wxLANGUAGE_XHOSA_SOUTH_AFRICA",
|
||||
["zu"] = "wxLANGUAGE_ZULU",
|
||||
["zu_ZA"] = "wxLANGUAGE_ZULU_SOUTH_AFRICA",
|
||||
["zh@Hans"] = "wxLANGUAGE_CHINESE_SIMPLIFIED_EXPLICIT",
|
||||
["zh@Hant"] = "wxLANGUAGE_CHINESE_TRADITIONAL_EXPLICIT",
|
||||
["zh_CN"] = "wxLANGUAGE_CHINESE_CHINA",
|
||||
["zh_HK"] = "wxLANGUAGE_CHINESE_HONGKONG",
|
||||
["zh_HK@Hans"] = "wxLANGUAGE_CHINESE_SIMPLIFIED_HONGKONG",
|
||||
["zh_MO"] = "wxLANGUAGE_CHINESE_MACAO",
|
||||
["zh_MO@Hans"] = "wxLANGUAGE_CHINESE_SIMPLIFIED_MACAO",
|
||||
["zh_SG"] = "wxLANGUAGE_CHINESE_SINGAPORE",
|
||||
["zh_TW"] = "wxLANGUAGE_CHINESE_TAIWAN"
|
||||
}
|
||||
end
|
||||
|
||||
--?? ["kr@latin"] = "wxLANGUAGE_KANURI_LATIN",
|
||||
--?? ["mn_MN"] = "wxLANGUAGE_MONGOLIAN_MONGOLIA",
|
||||
|
||||
function split(str, character)
|
||||
result = {}
|
||||
|
||||
index = 1
|
||||
for s in string.gmatch(str .. character, "(.-)"..character) do
|
||||
result[index] = s
|
||||
index = index + 1
|
||||
end
|
||||
|
||||
return result
|
||||
end
|
||||
|
||||
function string.tohex(str)
|
||||
return (str:gsub('.', function (c)
|
||||
cbyte = string.byte(c)
|
||||
if cbyte >= 20 and cbyte < 127 then
|
||||
return c
|
||||
else
|
||||
return string.format('\\%03o', string.byte(c))
|
||||
end
|
||||
end))
|
||||
end
|
||||
|
||||
function string.fromhex(str)
|
||||
return (str:gsub('..', function (cc)
|
||||
return tonumber(cc, 16)
|
||||
end))
|
||||
end
|
||||
|
||||
script2alias = scriptmap();
|
||||
locid2wxid = initmap()
|
||||
|
||||
fo2 = io.open('temp/langtabl_test.txt','w')
|
||||
|
||||
fo1 = io.open('temp/win_loadlocaletable.sql','w')
|
||||
fo1:write('-- List of locales supported by Windows\n-- Date: ' .. os.date("%Y-%m-%d %H:%M") .. '\n\n')
|
||||
fo1:write('-- Data source: MSDN\n\n')
|
||||
|
||||
fo1:write("create table if not exists win_localetable (locid char, wxlocid char, wxname char, wxlocidold char, wxnameold char, englishdisplay char, englishlanguage char, englishcountry char, scripts char, country3 char, script4 char, currency char, layout char, idlang char, idsublang char, nativedisplay char, nativelanguage char, nativecountry char, nativedisplayhex char, nativelanguagehex char, nativecountryhex char, primary key (locid));\n")
|
||||
fo1:write('delete from win_localetable;\nbegin;\n')
|
||||
|
||||
count = 0
|
||||
for line in io.lines(codeFileName) do
|
||||
rem = string.sub(line,1,1)
|
||||
if rem ~= "#" then
|
||||
values = split(line, "|")
|
||||
-- Column names and descriptions
|
||||
-- 1 LOCALE_SNAME, // Tag identifying the locale
|
||||
-- 2 LOCALE_SENGLISHDISPLAYNAME, // English locale name (example: "German (Germany)"
|
||||
-- 3 LOCALE_SENGLISHLANGUAGENAME, // English language name
|
||||
-- 4 LOCALE_SENGLISHCOUNTRYNAME, // English country name
|
||||
-- 5 LOCALE_SSCRIPTS, // List of scripts
|
||||
-- LOCALE_SISOCTRYNAME2
|
||||
-- 6 LOCALE_SINTLSYMBOL, // Currency symbol ISO
|
||||
-- 7 LOCALE_IREADINGLAYOUT, // Layout direction 0=LTR, 1=RTL, 2=TTB-RTL or LTR, 3=TTB-LTR
|
||||
-- 8 LOCALE_ILANGUAGE, // Numeric language code
|
||||
-- 9 LOCALE_SNATIVEDISPLAYNAME, // Native locale name (example: "Deutsch (Deutschland)"
|
||||
-- 10 LOCALE_SNATIVELANGUAGENAME, // Native language name
|
||||
-- 11 LOCALE_SNATIVECOUNTRYNAME // Native country name
|
||||
|
||||
locid = values[1]
|
||||
|
||||
-- Extract language, script, and region
|
||||
sep1, sep2 = string.find(locid, "-")
|
||||
if sep1 ~= nil then
|
||||
lcid = string.sub(locid, 1, sep1-1)
|
||||
ccid = string.sub(locid, sep2+1)
|
||||
sep1, sep2 = string.find(ccid, "-")
|
||||
if sep1 ~= nil then
|
||||
script = string.sub(ccid, 1, sep1-1)
|
||||
if #script < 4 then
|
||||
temp = script
|
||||
script = string.sub(ccid, sep2+1)
|
||||
ccid = temp
|
||||
else
|
||||
ccid = string.sub(ccid, sep2+1)
|
||||
end
|
||||
else
|
||||
if #ccid >= 4 then
|
||||
script = ccid
|
||||
ccid = ""
|
||||
else
|
||||
script = ""
|
||||
end
|
||||
end
|
||||
else
|
||||
lcid = locid
|
||||
script = ""
|
||||
ccid = ""
|
||||
end
|
||||
|
||||
ENGLISHDISPLAYNAME = values[2]
|
||||
ENGLISHDISPLAYNAME = ENGLISHDISPLAYNAME:gsub("&", "and")
|
||||
ENGLISHDISPLAYNAME = ENGLISHDISPLAYNAME:gsub("'", "''")
|
||||
ENGLISHDISPLAYNAMEHEX = string.tohex(ENGLISHDISPLAYNAME)
|
||||
if ENGLISHDISPLAYNAME ~= ENGLISHDISPLAYNAMEHEX then
|
||||
print('*** ' .. locid .. ' - Display name contains non-ASCII characters')
|
||||
end
|
||||
ENGLISHLANGUAGENAME = values[3]
|
||||
ENGLISHLANGUAGENAME = ENGLISHLANGUAGENAME:gsub("'", "''")
|
||||
ENGLISHCOUNTRYNAME = values[4]
|
||||
ENGLISHCOUNTRYNAME = ENGLISHCOUNTRYNAME:gsub("'", "''")
|
||||
ENGLISHCOUNTRYNAME = ENGLISHCOUNTRYNAME:gsub("&", "and")
|
||||
|
||||
SCRIPTS = values[5]
|
||||
if SCRIPTS ~= nil and #SCRIPTS > 4 then
|
||||
local b = string.find(SCRIPTS, ';')
|
||||
script4 = string.sub(SCRIPTS,1,b-1)
|
||||
else
|
||||
scripts4 = ''
|
||||
end
|
||||
COUNTRY3 = values[6]
|
||||
CURRENCY = values[7]
|
||||
LAYOUT = values[8]
|
||||
if LAYOUT ~= '1' then
|
||||
LAYOUT = 'LTR'
|
||||
else
|
||||
LAYOUT = 'RTL'
|
||||
end
|
||||
LCID = values[9]
|
||||
lcidnum = tonumber('0x'..LCID)
|
||||
lcidnum = lcidnum % 65536
|
||||
divisor = 1024
|
||||
idlang = lcidnum % divisor
|
||||
idsublang = (lcidnum - idlang) / divisor
|
||||
idlang = string.format("0x%02x", idlang)
|
||||
idsublang = string.format("0x%02x", idsublang)
|
||||
|
||||
-- Clean up names
|
||||
-- Replace single apostroph by 2 apostrophes (SQL requirement)
|
||||
NATIVEDISPLAYNAME = values[10]
|
||||
NATIVEDISPLAYNAME = NATIVEDISPLAYNAME:gsub("'", "''")
|
||||
NATIVEDISPLAYNAMEHEX = string.tohex(NATIVEDISPLAYNAME)
|
||||
NATIVELANGUAGENAME = values[11]
|
||||
NATIVELANGUAGENAME = NATIVELANGUAGENAME:gsub("'", "''")
|
||||
NATIVELANGUAGENAMEHEX = string.tohex(NATIVELANGUAGENAME)
|
||||
NATIVECOUNTRYNAME = values[12]
|
||||
NATIVECOUNTRYNAME = NATIVECOUNTRYNAME:gsub("'", "''")
|
||||
NATIVECOUNTRYNAMEHEX = string.tohex(NATIVECOUNTRYNAME)
|
||||
|
||||
-- Replace common characters with accents by the base character
|
||||
-- Needed to generate pure ASCII identifier for wxLANGUAGE symbols
|
||||
ENGLISHLANGUAGENAMEASC = ENGLISHLANGUAGENAME
|
||||
ENGLISHLANGUAGENAMEASC = ENGLISHLANGUAGENAMEASC:gsub("é", "e")
|
||||
ENGLISHLANGUAGENAMEASC = ENGLISHLANGUAGENAMEASC:gsub("ô", "o")
|
||||
ENGLISHLANGUAGENAMEASC = ENGLISHLANGUAGENAMEASC:gsub("’", "")
|
||||
ENGLISHLANGUAGENAMEASC = ENGLISHLANGUAGENAMEASC:gsub("'", "")
|
||||
ENGLISHLANGUAGENAMEASC = ENGLISHLANGUAGENAMEASC:gsub("-", "_")
|
||||
ENGLISHLANGUAGENAMEASC = ENGLISHLANGUAGENAMEASC:gsub("å", "a")
|
||||
ENGLISHLANGUAGENAMEASC = ENGLISHLANGUAGENAMEASC:gsub("ç", "c")
|
||||
ENGLISHLANGUAGENAMEASC = ENGLISHLANGUAGENAMEASC:gsub("ã", "a")
|
||||
ENGLISHLANGUAGENAMEASC = ENGLISHLANGUAGENAMEASC:gsub("Å", "A")
|
||||
ENGLISHLANGUAGENAMEASC = ENGLISHLANGUAGENAMEASC:gsub("ü", "u")
|
||||
ENGLISHLANGUAGENAMEASC = ENGLISHLANGUAGENAMEASC:gsub("ʼ", "")
|
||||
|
||||
ENGLISHCOUNTRYNAMEASC = ENGLISHCOUNTRYNAME
|
||||
ENGLISHCOUNTRYNAMEASC = ENGLISHCOUNTRYNAMEASC:gsub("é", "e")
|
||||
ENGLISHCOUNTRYNAMEASC = ENGLISHCOUNTRYNAMEASC:gsub("ô", "o")
|
||||
ENGLISHCOUNTRYNAMEASC = ENGLISHCOUNTRYNAMEASC:gsub("’", "")
|
||||
ENGLISHCOUNTRYNAMEASC = ENGLISHCOUNTRYNAMEASC:gsub("'", "")
|
||||
ENGLISHCOUNTRYNAMEASC = ENGLISHCOUNTRYNAMEASC:gsub("%.", "")
|
||||
ENGLISHCOUNTRYNAMEASC = ENGLISHCOUNTRYNAMEASC:gsub("-", "_")
|
||||
ENGLISHCOUNTRYNAMEASC = ENGLISHCOUNTRYNAMEASC:gsub("å", "a")
|
||||
ENGLISHCOUNTRYNAMEASC = ENGLISHCOUNTRYNAMEASC:gsub("ç", "c")
|
||||
ENGLISHCOUNTRYNAMEASC = ENGLISHCOUNTRYNAMEASC:gsub("ã", "a")
|
||||
ENGLISHCOUNTRYNAMEASC = ENGLISHCOUNTRYNAMEASC:gsub("Å", "A")
|
||||
ENGLISHCOUNTRYNAMEASC = ENGLISHCOUNTRYNAMEASC:gsub("ü", "u")
|
||||
ENGLISHCOUNTRYNAMEASC = ENGLISHCOUNTRYNAMEASC:gsub("í", "i")
|
||||
|
||||
-- Generate wxLANGUAGE symbol
|
||||
locidnew = lcid
|
||||
WXNAME = 'wxLANGUAGE_' .. string.upper(ENGLISHLANGUAGENAMEASC)
|
||||
if #ccid > 0 then
|
||||
locidnew = locidnew .. '_' .. ccid
|
||||
WXNAME = WXNAME .. '_' .. string.upper(ENGLISHCOUNTRYNAMEASC)
|
||||
end
|
||||
|
||||
-- Append script alias to locale identifier
|
||||
if #script > 0 then
|
||||
mappedscript = script2alias[script]
|
||||
if mappedscript ~= nil then
|
||||
scriptold = script
|
||||
script = mappedscript
|
||||
else
|
||||
mappedscript = 'n/a'
|
||||
end
|
||||
locidnew = locidnew .. '@' .. script
|
||||
-- print('-- New script: ' .. script .. ' - ' .. mappedscript .. ' ' .. locidnew)
|
||||
end
|
||||
|
||||
-- Replace blank characters by underscore
|
||||
-- Remove parentheses and commas
|
||||
WXNAME = WXNAME:gsub(" ", "_")
|
||||
WXNAME = WXNAME:gsub("%(", "")
|
||||
WXNAME = WXNAME:gsub("%)", "")
|
||||
WXNAME = WXNAME:gsub("%,", "")
|
||||
|
||||
-- Force specific wxLANGUAGE name for listed locale ids (compatibility with prior wxWidgets versions)
|
||||
mappedwxname = locid2wxid[locidnew]
|
||||
if mappedwxname ~= nil then
|
||||
WXNAME = mappedwxname
|
||||
else
|
||||
mappedwxname = 'n/a'
|
||||
end
|
||||
-- print('-- ' .. locidnew .. ' ' .. WXNAME .. ' ' .. mappedwxname)
|
||||
|
||||
-- Force columnar output by appending blank characters
|
||||
SWXNAME = string.format("%-55s", WXNAME)
|
||||
slocid = string.format("%-14s", locidnew)
|
||||
sidlang = string.format("%-4s", idlang)
|
||||
sidsublang = string.format("%-4s", idsublang)
|
||||
|
||||
fo1:write("insert into win_localetable values ('" .. locid .. "', '" .. locidnew .. "', '" .. WXNAME .. "', '-', '-', '" .. string.tohex(ENGLISHDISPLAYNAME) .. "', '" .. string.tohex(ENGLISHLANGUAGENAME) .. "', '" .. string.tohex(ENGLISHCOUNTRYNAME) .. "', '" .. SCRIPTS .. "', '" .. COUNTRY3 .. "', '" .. script4 .. "', '" .. CURRENCY .. "', '" .. LAYOUT .. "', '" .. sidlang .. "', '" .. sidsublang .. "', '" .. NATIVEDISPLAYNAME .. "', '" .. NATIVELANGUAGENAME .. "', '" .. NATIVECOUNTRYNAME .. "', '" .. NATIVEDISPLAYNAMEHEX .. "', '" .. NATIVELANGUAGENAMEHEX .. "', '" .. NATIVECOUNTRYNAMEHEX .. "');\n")
|
||||
|
||||
fo2:write(SWXNAME .. " " .. slocid .. " " .. sidlang .. " " .. sidsublang .. " " .. LAYOUT .. ' "' .. ENGLISHDISPLAYNAMEHEX .. '","' .. NATIVEDISPLAYNAMEHEX .. '"\n')
|
||||
|
||||
count = count + 1
|
||||
end
|
||||
end
|
||||
|
||||
-- Add manually entries for compatibility with prior wxWidgets versions
|
||||
fo1:write("insert into win_localetable values ('ab', 'ab', 'wxLANGUAGE_ABKHAZIAN', '-', '-', 'Abkhazian', 'Abkhazian', '', '', '', '', '', 'LTR', '-', '-', 'аҧсуа бызшәа', 'аҧсуа бызшәа', '', '" .. string.tohex('аҧсуа бызшәа') .. "', '" .. string.tohex('аҧсуа бызшәа') .. "', '');\n")
|
||||
fo1:write("insert into win_localetable values ('ay', 'ay', 'wxLANGUAGE_AYMARA', '-', '-', 'Aymara', 'Aymara', '', '', '', '', '', 'LTR', '-', '-', 'Aymara', 'Aymara', '', 'Aymara', 'Aymara', '');\n")
|
||||
fo1:write("insert into win_localetable values ('bh', 'bh', 'wxLANGUAGE_BIHARI', '-', '-', 'Bihari', 'Bihari', '', '', '', '', '', 'LTR', '-', '-', 'Bihari', 'Bihari', '', 'Bihari', 'Bihari', '');\n")
|
||||
fo1:write("insert into win_localetable values ('bi', 'bi', 'wxLANGUAGE_BISLAMA', '-', '-', 'Bislama', 'Bislama', '', '', '', '', '', 'LTR', '-', '-', 'Bislama', 'Bislama', 'Vanuatu', 'Bislama', 'Bislama', 'Vanuatu');\n")
|
||||
fo1:write("insert into win_localetable values ('en-CB', 'en_CB', 'wxLANGUAGE_ENGLISH_CARIBBEAN_CB', '-', '-', 'English (Caribbean)', 'English (Caribbean)', '', '', '', '', '', 'LTR', '0x09', '0x09', 'English (Caribbean)', 'English (Caribbean)', '', 'English (Caribbean)', 'English (Caribbean)', '');\n")
|
||||
|
||||
fo1:write("insert into win_localetable values ('fj', 'fj', 'wxLANGUAGE_FIJI', '-', '-', 'Fiji', 'Fiji', '', '', '', '', '', 'LTR', '-', '-', 'Na Vosa Vakaviti', 'Na Vosa Vakaviti', '', 'Na Vosa Vakaviti', 'Na Vosa Vakaviti', '');\n")
|
||||
fo1:write("insert into win_localetable values ('ie', 'ie', 'wxLANGUAGE_INTERLINGUE', '-', '-', 'Interlingue', 'Interlingue', '', '', '', '', '', 'LTR', '-', '-', 'Interlingue', 'Interlingue', '', 'Interlingue', 'Interlingue', '');\n")
|
||||
fo1:write("insert into win_localetable values ('ik', 'ik', 'wxLANGUAGE_INUPIAK', '-', '-', 'Inupiak', 'Inupiak', '', '', '', '', '', 'LTR', '-', '-', 'Inupiaq', 'Inupiaq', '', 'Inupiaq', 'Inupiaq', '');\n")
|
||||
fo1:write("insert into win_localetable values ('ks-IN', 'ks_IN', 'wxLANGUAGE_KASHMIRI_INDIA', '-', '-', 'Kashmiri (India)', 'Kashmiri', 'India', '', '', '', '', 'RTL', '0x00', '0x04', 'کشور (بھارت)', 'کٲشُر', 'ہِندوستان', '" .. string.tohex('کشور (بھارت)') .."', '" .. string.tohex('کٲشُر') .."', '" .. string.tohex('ہِندوستان') .."');\n")
|
||||
fo1:write("insert into win_localetable values ('ku-TR', 'ku_TR', 'wxLANGUAGE_KURDISH', '-', '-', 'Kurdish', 'Kurdish', '', '', '', '', '', 'LTR', '-', '-', 'Kurdî', 'Kurdî', '', '" .. string.tohex('Kurdî') .. "', '" .. string.tohex('Kurdî') .. "', '');\n")
|
||||
|
||||
fo1:write("insert into win_localetable values ('la-001', 'la_001', 'wxLANGUAGE_LATIN_WORLD', '-', '-', 'Latin (World)', 'Latin', 'World', '', '', '', '', 'LTR', '0x76', '0x01', 'Latina (World)', 'Latina', 'World', 'Latina (Mundus)', 'Latina', 'Mundus');\n")
|
||||
fo1:write("insert into win_localetable values ('mo', 'mo', 'wxLANGUAGE_MOLDAVIAN', '-', '-', 'Moldavian', 'Moldavian', '', '', '', '', '', 'LTR', '-', '-', 'лимба молдовеняскэ', 'лимба молдовеняскэ', '', '" .. string.tohex('лимба молдовеняскэ') .. "', '" .. string.tohex('лимба молдовеняскэ') .. "', '');\n")
|
||||
fo1:write("insert into win_localetable values ('na', 'na', 'wxLANGUAGE_NAURU', '-', '-', 'Nauru', 'Nauru', 'Nauru', '', '', '', '', 'LTR', '-', '-', 'Nauru', 'Nauru', 'Nauru', 'Nauru', 'Nauru', 'Nauru');\n")
|
||||
fo1:write("insert into win_localetable values ('qu', 'qu', 'wxLANGUAGE_QUECHUA_MACRO', '-', '-', 'Quechua', 'Quechua', '', '', '', '', '', 'LTR', '-', '-', 'Qhichwa', 'Qhichwa', '', 'Qhichwa', 'Qhichwa', '');\n")
|
||||
fo1:write("insert into win_localetable values ('sm', 'sm', 'wxLANGUAGE_SAMOAN', '-', '-', 'Samoan', 'Samoan', '', '', '', '', '', 'LTR', '-', '-', 'Samoa', 'Samoa', 'Samoa', 'Samoa', 'Samoa', 'Samoa');\n")
|
||||
|
||||
fo1:write("insert into win_localetable values ('sr-RS', 'sr_RS', 'wxLANGUAGE_SERBIAN_SERBIA', '-', '-', 'Serbian (Serbia)', 'Serbian', 'Serbia', '', '', '', '', 'LTR', '0x1a', '0x01', 'srpski (Srbija)', 'srpski', 'Srbija', 'srpski (Srbija)', 'srpski', 'Srbija');\n")
|
||||
fo1:write("insert into win_localetable values ('sr-YU', 'sr_YU', 'wxLANGUAGE_SERBIAN_YU', '-', '-', 'Serbian', 'Serbian', '', '', '', '', '', 'LTR', '0x1a', '0x01', 'srpski', 'srpski', 'Srbija', 'srpski', 'srpski', 'Srbija');\n")
|
||||
fo1:write("insert into win_localetable values ('sr-Cyrl-YU', 'sr_YU@cyrillic', 'wxLANGUAGE_SERBIAN_CYRILLIC_YU', '-', '-', 'Serbian (Cyrillic)', 'Serbian (Cyrillic)', '', 'Cyrl;', '', '', '', 'LTR', '0x1a', '0x03', 'српски (Србија)', 'српски', 'Србија', '" .. string.tohex('српски (Србија)') .. "', '" .. string.tohex('српски') .. "', '" .. string.tohex('Србија') .. "');\n")
|
||||
fo1:write("insert into win_localetable values ('sr-Latn-YU', 'sr_YU@latin', 'wxLANGUAGE_SERBIAN_LATIN_YU', '-', '-', 'Serbian (Latin)', 'Serbian (Latin)', '', 'Latn;', '', '', '', 'LTR', '0x1a', '0x02', 'srpski (latinica)', 'srpski', 'Srbija', 'srpski (latinica)', 'srpski', 'Srbija');\n")
|
||||
fo1:write("insert into win_localetable values ('sh', 'sh', 'wxLANGUAGE_SERBO_CROATIAN', '-', '-', 'Serbo-Croatian', 'Serbo-Croatian', '', '', '', '', '', 'LTR', '-', '-', 'srpskohrvatski', 'srpskohrvatski', '', 'srpskohrvatski', 'srpskohrvatski', '');\n")
|
||||
|
||||
fo1:write("insert into win_localetable values ('tl-PH', 'tl_PH', 'wxLANGUAGE_TAGALOG', '-', '-', 'Tagalog', 'Tagalog', 'Philippines', '', '', '', '', 'LTR', '-', '-', 'Tagalog', 'Tagalog', 'Pilipinas ', 'Tagalog', 'Tagalog', 'Pilipinas');\n")
|
||||
fo1:write("insert into win_localetable values ('tw', 'tw', 'wxLANGUAGE_TWI', '-', '-', 'Twi', 'Twi', '', '', '', '', '', 'LTR', '-', '-', 'Twi', 'Twi', 'Ghana', 'Twi', 'Twi', 'Ghana');\n")
|
||||
fo1:write("insert into win_localetable values ('za', 'za', 'wxLANGUAGE_ZHUANG', '-', '-', 'Zhuang', 'Zhuang', '', '', '', '', '', 'LTR', '-', '-', 'Zhuang', 'Zhuang', 'China', 'Zhuang', 'Zhuang', 'China');\n")
|
||||
|
||||
-- Update count to reflect manual entries (needs to be updated, if entries are added or removed)
|
||||
count = count + 23
|
||||
print("Number of locales=" .. count)
|
||||
|
||||
fo1:write('commit;\n')
|
||||
fo1:close()
|
||||
|
||||
fo2:close()
|
||||
25
misc/languages/data/wx/wx_loadlangtabl.lua
Normal file
25
misc/languages/data/wx/wx_loadlangtabl.lua
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
-- Assign script arguments and check validity
|
||||
codeFileName = "temp/langtabl_current.txt"
|
||||
|
||||
function trim(s)
|
||||
return s:match'^%s*(.*%S)' or ''
|
||||
end
|
||||
|
||||
fo2 = io.open('temp/wx_loadlangtabl.sql','w')
|
||||
fo2:write("create table if not exists wx_langmap (wxlangname char, wxlangid char, wxlocregion, wxversion char, primary key (wxlangname));\n")
|
||||
fo2:write('delete from wx_langmap;\nbegin;\n')
|
||||
|
||||
count = 0
|
||||
for line in io.lines(codeFileName) do
|
||||
wxlangname = trim(string.sub(line,1,55))
|
||||
wxversion = trim(string.sub(line,57,65))
|
||||
wxlangid = trim(string.sub(line,82,106))
|
||||
wxlocregion = trim(string.sub(line,108,121))
|
||||
|
||||
fo2:write("insert into wx_langmap values ('" .. wxlangname .. "', '" .. wxlangid .. "', '" .. wxlocregion .. "', '" .. wxversion .. "');\n")
|
||||
count = count + 1
|
||||
end
|
||||
print("Number of languages =" .. count)
|
||||
|
||||
fo2:write('commit;\n')
|
||||
fo2:close()
|
||||
45
misc/languages/data/wx/wx_loadsynonymtabl.lua
Normal file
45
misc/languages/data/wx/wx_loadsynonymtabl.lua
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
-- Assign script arguments and check validity
|
||||
codeFileName = "temp/synonymtabl_current.txt"
|
||||
|
||||
function trim(s)
|
||||
return s:match'^%s*(.*%S)' or ''
|
||||
end
|
||||
|
||||
function split(str, character)
|
||||
result = {}
|
||||
|
||||
index = 1
|
||||
-- (.-),
|
||||
-- for s in string.gmatch(str, "[^"..character.."]+") do
|
||||
for s in string.gmatch(str .. character, "(.-)"..character) do
|
||||
result[index] = s
|
||||
index = index + 1
|
||||
end
|
||||
|
||||
return result
|
||||
end
|
||||
|
||||
fo2 = io.open('temp/wx_loadsynonymtabl.sql','w')
|
||||
fo2:write('-- Known syonyms in wx\n-- Date: ' .. os.date("%Y-%m-%d %H:%M") .. '\n\n')
|
||||
fo2:write("create table if not exists wx_synonyms (wxnamesyn char, wxnameprim char, winlocid char, wxversion char, primary key (wxnamesyn));\n")
|
||||
fo2:write('delete from wx_synonyms;\nbegin;\n')
|
||||
|
||||
-- Code|N°|English Name|Nom français|Alias|Age|Date
|
||||
|
||||
count = 0
|
||||
for line in io.lines(codeFileName) do
|
||||
rem = string.sub(line,1,1)
|
||||
if rem ~= "#" then
|
||||
wxnamesyn = trim(string.sub(line,1,55))
|
||||
wxnameprim = trim(string.sub(line,57,111))
|
||||
winlocid = trim(string.sub(line,113,126))
|
||||
wxversion = trim(string.sub(line,128,136))
|
||||
|
||||
fo2:write("insert into wx_synonyms values ('" .. wxnamesyn .. "', '" .. wxnameprim .. "', '" .. winlocid .. "', '" .. wxversion .. "');\n")
|
||||
count = count + 1
|
||||
end
|
||||
end
|
||||
print("Number of synonyms=" .. count)
|
||||
|
||||
fo2:write('commit;\n')
|
||||
fo2:close()
|
||||
32
misc/languages/data/wx/wx_readversion.lua
Normal file
32
misc/languages/data/wx/wx_readversion.lua
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
-- Retrieve current wxWidgets version
|
||||
codeFileName = "../../../include/wx/version.h"
|
||||
|
||||
function trim(s)
|
||||
return s:match'^%s*(.*%S)' or ''
|
||||
end
|
||||
|
||||
fo2 = io.open('temp/wx_loadversion.sql','w')
|
||||
fo2:write('-- Current wxWidgets version\n-- Date: ' .. os.date("%Y-%m-%d %H:%M") .. '\n\n')
|
||||
fo2:write("create table if not exists wx_version (version char, primary key (version));\n")
|
||||
fo2:write('delete from wx_version;\nbegin;\n')
|
||||
|
||||
count = 0
|
||||
for line in io.lines(codeFileName) do
|
||||
vkey = trim(string.sub(line,1,28))
|
||||
vval = trim(string.sub(line,30,35))
|
||||
if vkey == "#define wxMAJOR_VERSION" then
|
||||
vmajor = vval
|
||||
elseif vkey == "#define wxMINOR_VERSION" then
|
||||
vminor = vval
|
||||
elseif vkey == "#define wxRELEASE_NUMBER" then
|
||||
vrelno = vval
|
||||
elseif vkey == "#define wxSUBRELEASE_NUMBER" then
|
||||
vsubno = vval
|
||||
end
|
||||
end
|
||||
wxversion = vmajor .. "." .. vminor .. "." .. vrelno
|
||||
print("wx version number=" .. wxversion)
|
||||
fo2:write("insert into wx_version values('" .. wxversion .. "');\n")
|
||||
|
||||
fo2:write('commit;\n')
|
||||
fo2:close()
|
||||
|
|
@ -24,6 +24,19 @@ def ReadScriptTable():
|
|||
f.close()
|
||||
return scripttable
|
||||
|
||||
def ReadSynonymTable():
|
||||
synonymtable = []
|
||||
try:
|
||||
f = open('misc/languages/synonymtabl.txt')
|
||||
except:
|
||||
print("Did you run the script from top-level wxWidgets directory?")
|
||||
raise
|
||||
|
||||
for i in f.readlines():
|
||||
ispl = i.split()
|
||||
synonymtable.append((ispl[0], ispl[1], ispl[2], ispl[3]))
|
||||
f.close()
|
||||
return synonymtable
|
||||
|
||||
def ReadTable():
|
||||
table = []
|
||||
|
|
@ -35,19 +48,14 @@ def ReadTable():
|
|||
|
||||
for i in f.readlines():
|
||||
ispl = i.split()
|
||||
table.append((ispl[0], ispl[1], ispl[2], ispl[3], ispl[4], ispl[5], ispl[6], ' '.join(ispl[7:])))
|
||||
table.append((ispl[0], ispl[1], ispl[2], ispl[3], ispl[4], ispl[5], ispl[6], ispl[7], ' '.join(ispl[8:])))
|
||||
f.close()
|
||||
return table
|
||||
|
||||
|
||||
def WriteEnum(f, table, scripttable):
|
||||
# Kind may be "include" or "interface".
|
||||
def WriteEnum(f, table, synonymtable, scripttable, kind = 'include'):
|
||||
f.write("""
|
||||
/**
|
||||
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/preferred language as got from OS.
|
||||
|
|
@ -58,45 +66,46 @@ enum wxLanguage
|
|||
|
||||
""");
|
||||
knownLangs = []
|
||||
output = ''
|
||||
for i in table:
|
||||
if i[0] not in knownLangs:
|
||||
f.write(' %s,\n' % i[0])
|
||||
knownLangs.append(i[0])
|
||||
f.write("""
|
||||
lang = i[0]
|
||||
wxver = i[1]
|
||||
if lang not in knownLangs:
|
||||
output += ' %s,' % lang
|
||||
if kind == 'interface' and wxver != '-':
|
||||
output += '%s///< @since_wx{%s}' % (' ' * (56 - len(lang)), wxver)
|
||||
output += '\n'
|
||||
knownLangs.append(lang)
|
||||
output += """
|
||||
/// For custom, user-defined languages.
|
||||
wxLANGUAGE_USER_DEFINED,
|
||||
"""
|
||||
|
||||
/// Synonyms.
|
||||
wxLANGUAGE_AZERI = wxLANGUAGE_AZERBAIJANI,
|
||||
wxLANGUAGE_AZERI_CYRILLIC = wxLANGUAGE_AZERBAIJANI_CYRILLIC,
|
||||
wxLANGUAGE_AZERI_LATIN = wxLANGUAGE_AZERBAIJANI_LATIN,
|
||||
wxLANGUAGE_BENGALI = wxLANGUAGE_BANGLA,
|
||||
wxLANGUAGE_BENGALI_BANGLADESH = wxLANGUAGE_BANGLA_BANGLADESH,
|
||||
wxLANGUAGE_BENGALI_INDIA = wxLANGUAGE_BANGLA_INDIA,
|
||||
wxLANGUAGE_BHUTANI = wxLANGUAGE_DZONGKHA,
|
||||
wxLANGUAGE_CHINESE_SIMPLIFIED = wxLANGUAGE_CHINESE_CHINA,
|
||||
wxLANGUAGE_CHINESE_TRADITIONAL = wxLANGUAGE_CHINESE_TAIWAN,
|
||||
wxLANGUAGE_CHINESE_MACAU = wxLANGUAGE_CHINESE_MACAO,
|
||||
wxLANGUAGE_KANURI_NIGERIA = wxLANGUAGE_KANURI_LATIN_NIGERIA,
|
||||
wxLANGUAGE_KASHMIRI_PERSO_ARABIC = wxLANGUAGE_KASHMIRI_ARABIC,
|
||||
wxLANGUAGE_KASHMIRI_PERSO_ARABIC_INDIA = wxLANGUAGE_KASHMIRI_ARABIC_INDIA,
|
||||
wxLANGUAGE_KERNEWEK = wxLANGUAGE_CORNISH,
|
||||
wxLANGUAGE_KURDISH_PERSO_ARABIC_IRAN = wxLANGUAGE_KURDISH_ARABIC_IRAN,
|
||||
wxLANGUAGE_MALAY_BRUNEI_DARUSSALAM = wxLANGUAGE_MALAY_BRUNEI,
|
||||
wxLANGUAGE_ORIYA = wxLANGUAGE_ODIA,
|
||||
wxLANGUAGE_ORIYA_INDIA = wxLANGUAGE_ODIA_INDIA,
|
||||
wxLANGUAGE_SPANISH_MODERN = wxLANGUAGE_SPANISH,
|
||||
wxLANGUAGE_UZBEK_PERSO_ARABIC = wxLANGUAGE_UZBEK_ARABIC,
|
||||
wxLANGUAGE_UZBEK_PERSO_ARABIC_AFGHANISTAN = wxLANGUAGE_UZBEK_ARABIC_AFGHANISTAN,
|
||||
if kind == 'include':
|
||||
output += '\n /// Synonyms.'
|
||||
|
||||
/// Obsolete synonym.
|
||||
wxLANGUAGE_CAMBODIAN = wxLANGUAGE_KHMER
|
||||
};
|
||||
output += '\n'
|
||||
|
||||
""")
|
||||
for i in synonymtable:
|
||||
lang = i[0]
|
||||
synonym = i[1]
|
||||
wxver = i[3]
|
||||
output += ' %s' % lang
|
||||
if kind == 'include':
|
||||
output += ' = %s,\n' % synonym
|
||||
elif kind == 'interface':
|
||||
if wxver != '-':
|
||||
output += ',%s///< Synonym for %s. @since_wx{%s}\n' % (' ' * (42 - len(lang)), synonym, wxver)
|
||||
else:
|
||||
output += ',%s///< Synonym for %s.\n' % (' ' * (42 - len(lang)), synonym)
|
||||
else:
|
||||
print("Unknown kind of generated enum")
|
||||
raise
|
||||
|
||||
output += '};\n\n'
|
||||
f.write(output)
|
||||
|
||||
def WriteTable(f, table, scripttable):
|
||||
def WriteTable(f, table, synonymtable, scripttable):
|
||||
sctable = ''
|
||||
for i in scripttable:
|
||||
scname = '"%s"' % i[0]
|
||||
|
|
@ -106,23 +115,23 @@ def WriteTable(f, table, scripttable):
|
|||
lngtable = ''
|
||||
|
||||
for i in table:
|
||||
ibcp47 = '"%s"' % i[1]
|
||||
ican = '"%s"' % i[2]
|
||||
ibcp47 = '"%s"' % i[2]
|
||||
ican = '"%s"' % i[3]
|
||||
if ican == '"-"': ican = '""'
|
||||
icanbase = '"%s"' % i[3]
|
||||
icanbase = '"%s"' % i[4]
|
||||
if icanbase == '"-"': icanbase = '""'
|
||||
ilang = i[4]
|
||||
ilang = i[5]
|
||||
if ilang == '-': ilang = '0'
|
||||
isublang = i[5]
|
||||
isublang = i[6]
|
||||
if isublang == '-': isublang = '0'
|
||||
if (i[6] == "LTR") :
|
||||
if (i[7] == "LTR") :
|
||||
ilayout = "wxLayout_LeftToRight"
|
||||
elif (i[6] == "RTL"):
|
||||
elif (i[7] == "RTL"):
|
||||
ilayout = "wxLayout_RightToLeft"
|
||||
else:
|
||||
print("ERROR: Invalid value for the layout direction")
|
||||
lngtable += ' { %-60s %-17s, %-28s, %-15s, %-4s, %-4s, %s, %s },\n' % \
|
||||
((i[0]+','), ibcp47, ican, icanbase, ilang, isublang, ilayout, i[7])
|
||||
((i[0]+','), ibcp47, ican, icanbase, ilang, isublang, ilayout, i[8])
|
||||
|
||||
f.write("""
|
||||
// The following data tables are generated by misc/languages/genlang.py
|
||||
|
|
@ -221,7 +230,7 @@ def ReplaceGeneratedPartOfFile(fname, func):
|
|||
print('Unexpected starting comment.')
|
||||
betweenBeginAndEnd = 1
|
||||
fout.write(l)
|
||||
func(fout, table, scripttable)
|
||||
func(fout, table, synonymtable, scripttable)
|
||||
elif l == '// --- --- --- generated code ends here --- --- ---\n':
|
||||
if not betweenBeginAndEnd:
|
||||
print('End comment found before the starting one?')
|
||||
|
|
@ -245,6 +254,7 @@ def ReplaceGeneratedPartOfFile(fname, func):
|
|||
|
||||
table = ReadTable()
|
||||
scripttable = ReadScriptTable()
|
||||
synonymtable = ReadSynonymTable()
|
||||
ReplaceGeneratedPartOfFile('include/wx/language.h', WriteEnum)
|
||||
ReplaceGeneratedPartOfFile('interface/wx/language.h', WriteEnum)
|
||||
ReplaceGeneratedPartOfFile('interface/wx/language.h', lambda f, table, synonymtable, scripttable: WriteEnum(f, table, synonymtable, scripttable, 'interface'))
|
||||
ReplaceGeneratedPartOfFile('src/common/languageinfo.cpp', WriteTable)
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -23,6 +23,7 @@ Cham cham
|
|||
Cher cherokee
|
||||
Chrs chorasmian
|
||||
Copt coptic
|
||||
Cpmn cypro_minoan
|
||||
Cprt cypriot
|
||||
Cyrl cyrillic
|
||||
Deva devanagari
|
||||
|
|
@ -103,6 +104,7 @@ Orkh old_turkic
|
|||
Orya oriya
|
||||
Osge osage
|
||||
Osma osmanya
|
||||
Ougr old_uyghur
|
||||
Palm palmyrene
|
||||
Pauc pau_cin_hau
|
||||
Perm old_permic
|
||||
|
|
@ -145,8 +147,11 @@ Thaa thaana
|
|||
Thai thai
|
||||
Tibt tibetan
|
||||
Tirh tirhuta
|
||||
Tnsa tangsa
|
||||
Toto toto
|
||||
Ugar ugaritic
|
||||
Vaii vai
|
||||
Vith vithkuqi
|
||||
Wara warang_citi
|
||||
Wcho wancho
|
||||
Xpeo old_persian
|
||||
|
|
|
|||
24
misc/languages/synonymtabl.txt
Normal file
24
misc/languages/synonymtabl.txt
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
wxLANGUAGE_AZERI wxLANGUAGE_AZERBAIJANI az -
|
||||
wxLANGUAGE_AZERI_CYRILLIC wxLANGUAGE_AZERBAIJANI_CYRILLIC az-Cyrl -
|
||||
wxLANGUAGE_AZERI_LATIN wxLANGUAGE_AZERBAIJANI_LATIN az-Latn -
|
||||
wxLANGUAGE_BENGALI wxLANGUAGE_BANGLA bn -
|
||||
wxLANGUAGE_BENGALI_BANGLADESH wxLANGUAGE_BANGLA_BANGLADESH bn-BD -
|
||||
wxLANGUAGE_BENGALI_INDIA wxLANGUAGE_BANGLA_INDIA bn-IN -
|
||||
wxLANGUAGE_BHUTANI wxLANGUAGE_DZONGKHA dz -
|
||||
wxLANGUAGE_CAMBODIAN wxLANGUAGE_KHMER km -
|
||||
wxLANGUAGE_CHINESE_MACAU wxLANGUAGE_CHINESE_MACAO zh-MO -
|
||||
wxLANGUAGE_CHINESE_SIMPLIFIED wxLANGUAGE_CHINESE_CHINA zh-CN -
|
||||
wxLANGUAGE_CHINESE_TRADITIONAL wxLANGUAGE_CHINESE_TAIWAN zh-TW -
|
||||
wxLANGUAGE_FARSI wxLANGUAGE_PERSIAN fa -
|
||||
wxLANGUAGE_GREENLANDIC wxLANGUAGE_KALAALLISUT_GREENLAND kl_GL -
|
||||
wxLANGUAGE_KANURI_NIGERIA wxLANGUAGE_KANURI_LATIN_NIGERIA kr-Latn-NG -
|
||||
wxLANGUAGE_KASHMIRI_PERSO_ARABIC wxLANGUAGE_KASHMIRI_ARABIC ks-Arab 3.1.6
|
||||
wxLANGUAGE_KASHMIRI_PERSO_ARABIC_INDIA wxLANGUAGE_KASHMIRI_ARABIC_INDIA ks-Arab-IN 3.1.6
|
||||
wxLANGUAGE_KERNEWEK wxLANGUAGE_CORNISH kw -
|
||||
wxLANGUAGE_KURDISH_PERSO_ARABIC_IRAN wxLANGUAGE_KURDISH_ARABIC_IRAN ku-Arab-IR -
|
||||
wxLANGUAGE_MALAY_BRUNEI_DARUSSALAM wxLANGUAGE_MALAY_BRUNEI ms-BN -
|
||||
wxLANGUAGE_ORIYA wxLANGUAGE_ODIA or -
|
||||
wxLANGUAGE_ORIYA_INDIA wxLANGUAGE_ODIA_INDIA or-IN -
|
||||
wxLANGUAGE_SPANISH_MODERN wxLANGUAGE_SPANISH es -
|
||||
wxLANGUAGE_UZBEK_PERSO_ARABIC wxLANGUAGE_UZBEK_ARABIC uz-Arab 3.1.6
|
||||
wxLANGUAGE_UZBEK_PERSO_ARABIC_AFGHANISTAN wxLANGUAGE_UZBEK_ARABIC_AFGHANISTAN uz-Arab-AF 3.1.6
|
||||
81
misc/languages/util/showlocales.c
Normal file
81
misc/languages/util/showlocales.c
Normal file
|
|
@ -0,0 +1,81 @@
|
|||
#include <windows.h>
|
||||
#include <stdio.h>
|
||||
|
||||
// All of the LCTYPES new to Windows Vista
|
||||
LCTYPE winLocaleTypes[] =
|
||||
{
|
||||
LOCALE_SNAME, // Tag identifying the locale
|
||||
LOCALE_SENGLISHDISPLAYNAME, // English locale name (example: "German (Germany)"
|
||||
LOCALE_SENGLISHLANGUAGENAME, // English language name
|
||||
LOCALE_SENGLISHCOUNTRYNAME, // English country name
|
||||
LOCALE_SSCRIPTS, // List of scripts
|
||||
LOCALE_SISO3166CTRYNAME2,
|
||||
LOCALE_SINTLSYMBOL, // Currency symbol ISO
|
||||
LOCALE_IREADINGLAYOUT, // Layout direction 0=LTR, 1=RTL, 2=TTB-RTL or LTR, 3=TTB-LTR
|
||||
LOCALE_ILANGUAGE, // Numeric language code
|
||||
LOCALE_SNATIVEDISPLAYNAME, // Native locale name (example: "Deutsch (Deutschland)"
|
||||
LOCALE_SNATIVELANGUAGENAME, // Native language name
|
||||
LOCALE_SNATIVECOUNTRYNAME // Native country name
|
||||
};
|
||||
|
||||
// Strings so we can print out the LCTYPES
|
||||
LPCWSTR winLocaleTypeNames[] =
|
||||
{
|
||||
L"LOCALE_SNAME", // Tag identifying the locale
|
||||
L"LOCALE_SENGLISHDISPLAYNAME", // English locale name (example: "German (Germany)"
|
||||
L"LOCALE_SENGLISHLANGUAGENAME", // English language name
|
||||
L"LOCALE_SENGLISHCOUNTRYNAME", // English country name
|
||||
L"LOCALE_SSCRIPTS", // List of scripts
|
||||
L"LOCALE_SISO3166CTRYNAME2",
|
||||
L"LOCALE_SINTLSYMBOL", // Currency symbol ISO
|
||||
L"LOCALE_IREADINGLAYOUT", // Layout direction 0=LTR, 1=RTL, 2=TTB-RTL or LTR, 3=TTB-LTR
|
||||
L"LOCALE_ILANGUAGE", // Numeric language code
|
||||
L"LOCALE_SNATIVEDISPLAYNAME", // Native locale name (example: "Deutsch (Deutschland)"
|
||||
L"LOCALE_SNATIVELANGUAGENAME", // Native language name
|
||||
L"LOCALE_SNATIVECOUNTRYNAME" // Native country name
|
||||
};
|
||||
|
||||
// Callback for EnumSystemLocalesEx()
|
||||
#define BUFFER_SIZE 512
|
||||
BOOL CALLBACK MyFuncLocaleEx(LPWSTR pStr, DWORD dwFlags, LPARAM lparam)
|
||||
{
|
||||
if (*pStr == 0) return (TRUE);
|
||||
|
||||
UNREFERENCED_PARAMETER(dwFlags);
|
||||
UNREFERENCED_PARAMETER(lparam);
|
||||
WCHAR wcBuffer[BUFFER_SIZE];
|
||||
char utf8Buffer[BUFFER_SIZE*4];
|
||||
|
||||
int iResult;
|
||||
int i;
|
||||
|
||||
// Loop through all specified LCTYPES and do GetLocaleInfoEx on them
|
||||
for (i = 0; i < sizeof(winLocaleTypes) / sizeof(winLocaleTypes[0]); i++)
|
||||
{
|
||||
// Get this LCTYPE result for this locale
|
||||
iResult = GetLocaleInfoEx(pStr, winLocaleTypes[i], wcBuffer, BUFFER_SIZE);
|
||||
|
||||
// If it succeeds, print it out
|
||||
if (i != 0) printf("|");
|
||||
if (iResult > 0)
|
||||
{
|
||||
WideCharToMultiByte(CP_UTF8, 0, wcBuffer, -1, utf8Buffer, BUFFER_SIZE*4, NULL, NULL);
|
||||
printf(utf8Buffer);
|
||||
}
|
||||
else
|
||||
{
|
||||
//wprintf(L" %s had error %d\n", NewTypeNames[i], GetLastError());
|
||||
}
|
||||
}
|
||||
printf("\n");
|
||||
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
UNREFERENCED_PARAMETER(argc);
|
||||
// Enumerate the known locales and report on them
|
||||
// LOCALE_ALL = LOCALE_WINDOWS | LOCALE_SUPPLEMENTAL | LOCALE_ALTERNATE_SORTS | LOCALE_NEUTRALDATA
|
||||
EnumSystemLocalesEx( MyFuncLocaleEx, LOCALE_WINDOWS, (LPARAM)argv, NULL);
|
||||
}
|
||||
|
|
@ -203,8 +203,8 @@ tabLangData[] =
|
|||
{ wxLANGUAGE_CENTRAL_ATLAS_TAMAZIGHT_TIFINAGH, "tzm-Tfng" , "tzm@tifinagh" , "" , 0x5f, 0x04, wxLayout_LeftToRight, "Central Atlas Tamazight (Tifinagh)","Tamazight (Tifinagh)" },
|
||||
{ wxLANGUAGE_CENTRAL_ATLAS_TAMAZIGHT_TIFINAGH_MOROCCO, "tzm-Tfng-MA" , "tzm_MA@tifinagh" , "" , 0x5f, 0x04, wxLayout_LeftToRight, "Central Atlas Tamazight (Tifinagh, Morocco)","\342\265\234\342\264\260\342\265\216\342\264\260\342\265\243\342\265\211\342\265\226\342\265\234 (\342\265\215\342\265\216\342\265\226\342\265\224\342\265\211\342\264\261)" },
|
||||
{ wxLANGUAGE_CENTRAL_KURDISH, "ku" , "ku" , "" , 0x92, 0x01, wxLayout_RightToLeft, "Central Kurdish","\332\251\331\210\330\261\330\257\333\214\333\214 \331\206\330\247\331\210\333\225\332\225\330\247\330\263\330\252" },
|
||||
{ wxLANGUAGE_CENTRAL_KURDISH, "ku-Arab" , "ku@arabic" , "" , 0x92, 0x01, wxLayout_RightToLeft, "Central Kurdish","\332\251\331\210\330\261\330\257\333\214\333\214 \331\206\330\247\331\210\333\225\332\225\330\247\330\263\330\252" },
|
||||
{ wxLANGUAGE_CENTRAL_KURDISH_IRAQ, "ku-Arab-IQ" , "ku_IQ@arabic" , "" , 0x92, 0x01, wxLayout_RightToLeft, "Central Kurdish (Iraq)","\332\251\331\210\330\261\330\257\333\214\333\214 \331\206\330\247\331\210\333\225\332\225\330\247\330\263\330\252 (\330\271\333\216\330\261\330\247\331\202)" },
|
||||
{ wxLANGUAGE_CENTRAL_KURDISH_ARABIC, "ku-Arab" , "ku@arabic" , "" , 0x92, 0x01, wxLayout_RightToLeft, "Central Kurdish","\332\251\331\210\330\261\330\257\333\214\333\214 \331\206\330\247\331\210\333\225\332\225\330\247\330\263\330\252" },
|
||||
{ wxLANGUAGE_CENTRAL_KURDISH_ARABIC_IRAQ, "ku-Arab-IQ" , "ku_IQ@arabic" , "" , 0x92, 0x01, wxLayout_RightToLeft, "Central Kurdish (Iraq)","\332\251\331\210\330\261\330\257\333\214\333\214 \331\206\330\247\331\210\333\225\332\225\330\247\330\263\330\252 (\330\271\333\216\330\261\330\247\331\202)" },
|
||||
{ wxLANGUAGE_CHAKMA, "ccp" , "ccp" , "" , 0x00, 0x04, wxLayout_LeftToRight, "Chakma","\360\221\204\214\360\221\204\213\360\221\204\264\360\221\204\237\360\221\204\263\360\221\204\246" },
|
||||
{ wxLANGUAGE_CHAKMA_CHAKMA, "ccp-Cakm" , "ccp@chakma" , "" , 0x00, 0x04, wxLayout_LeftToRight, "Chakma (Chakma)","\360\221\204\214\360\221\204\213\360\221\204\264\360\221\204\237\360\221\204\263\360\221\204\246 (\360\221\204\214\360\221\204\207\360\221\204\264\360\221\204\237)" },
|
||||
{ wxLANGUAGE_CHAKMA_CHAKMA_BANGLADESH, "ccp-Cakm-BD" , "ccp_BD@chakma" , "" , 0x00, 0x04, wxLayout_LeftToRight, "Chakma (Chakma, Bangladesh)","\360\221\204\214\360\221\204\213\360\221\204\264\360\221\204\237\360\221\204\263\360\221\204\246 (\360\221\204\235\360\221\204\201\360\221\204\243\360\221\204\230\360\221\204\254\360\221\204\214\360\221\204\264)" },
|
||||
|
|
@ -385,7 +385,6 @@ tabLangData[] =
|
|||
{ wxLANGUAGE_FAEROESE, "fo" , "fo" , "fo_FO" , 0x38, 0x01, wxLayout_LeftToRight, "Faroese","f\303\270royskt" },
|
||||
{ wxLANGUAGE_FAEROESE_DENMARK, "fo-DK" , "fo_DK" , "" , 0x00, 0x04, wxLayout_LeftToRight, "Faroese (Denmark)","f\303\270royskt (Danmark)" },
|
||||
{ wxLANGUAGE_FAEROESE_FAROE_ISLANDS, "fo-FO" , "fo_FO" , "" , 0x38, 0x01, wxLayout_LeftToRight, "Faroese (Faroe Islands)","f\303\270royskt (F\303\270royar)" },
|
||||
{ wxLANGUAGE_FARSI, "fa" , "fa" , "fa_IR" , 0x29, 0x01, wxLayout_RightToLeft, "Persian","\331\201\330\247\330\261\330\263\333\214" },
|
||||
{ wxLANGUAGE_FIJI, "fj" , "fj" , "" , 0 , 0 , wxLayout_LeftToRight, "Fiji","Na Vosa Vakaviti" },
|
||||
{ wxLANGUAGE_FILIPINO, "fil" , "fil" , "fil_PH" , 0x64, 0x01, wxLayout_LeftToRight, "Filipino","Filipino" },
|
||||
{ wxLANGUAGE_FILIPINO_PHILIPPINES, "fil-PH" , "fil_PH" , "" , 0x64, 0x01, wxLayout_LeftToRight, "Filipino (Philippines)","Filipino (Pilipinas)" },
|
||||
|
|
@ -487,7 +486,6 @@ tabLangData[] =
|
|||
{ wxLANGUAGE_GREEK, "el" , "el" , "el_GR" , 0x08, 0x01, wxLayout_LeftToRight, "Greek","\316\225\316\273\316\273\316\267\316\275\316\271\316\272\316\254" },
|
||||
{ wxLANGUAGE_GREEK_CYPRUS, "el-CY" , "el_CY" , "" , 0x00, 0x04, wxLayout_LeftToRight, "Greek (Cyprus)","\316\225\316\273\316\273\316\267\316\275\316\271\316\272\316\254 (\316\232\317\215\317\200\317\201\316\277\317\202)" },
|
||||
{ wxLANGUAGE_GREEK_GREECE, "el-GR" , "el_GR" , "" , 0x08, 0x01, wxLayout_LeftToRight, "Greek (Greece)","\316\225\316\273\316\273\316\267\316\275\316\271\316\272\316\254 (\316\225\316\273\316\273\316\254\316\264\316\261)" },
|
||||
{ wxLANGUAGE_GREENLANDIC, "kl-GL" , "kl_GL" , "" , 0x6f, 0x01, wxLayout_LeftToRight, "Kalaallisut (Greenland)","kalaallisut (Kalaallit Nunaat)" },
|
||||
{ wxLANGUAGE_GUARANI, "gn" , "gn" , "gn_PY" , 0x74, 0x01, wxLayout_LeftToRight, "Guarani","Ava\303\261e\342\200\231\341\272\275" },
|
||||
{ wxLANGUAGE_GUARANI_PARAGUAY, "gn-PY" , "gn_PY" , "" , 0x74, 0x01, wxLayout_LeftToRight, "Guarani (Paraguay)","Ava\303\261e\342\200\231\341\272\275 (Paragu\303\241i)" },
|
||||
{ wxLANGUAGE_GUJARATI, "gu" , "gu" , "gu_IN" , 0x47, 0x01, wxLayout_LeftToRight, "Gujarati","\340\252\227\340\253\201\340\252\234\340\252\260\340\252\276\340\252\244\340\253\200" },
|
||||
|
|
@ -535,10 +533,10 @@ tabLangData[] =
|
|||
{ wxLANGUAGE_JAPANESE, "ja" , "ja" , "ja_JP" , 0x11, 0x01, wxLayout_LeftToRight, "Japanese","\346\227\245\346\234\254\350\252\236" },
|
||||
{ wxLANGUAGE_JAPANESE_JAPAN, "ja-JP" , "ja_JP" , "" , 0x11, 0x01, wxLayout_LeftToRight, "Japanese (Japan)","\346\227\245\346\234\254\350\252\236 (\346\227\245\346\234\254)" },
|
||||
{ wxLANGUAGE_JAVANESE, "jv" , "jv" , "" , 0x00, 0x04, wxLayout_LeftToRight, "Javanese","Basa Jawa" },
|
||||
{ wxLANGUAGE_JAVANESE, "jv-Latn" , "jv@latin" , "jv" , 0x00, 0x04, wxLayout_LeftToRight, "Javanese","Basa Jawa" },
|
||||
{ wxLANGUAGE_JAVANESE_INDONESIA, "jv-Latn-ID" , "jv_ID@latin" , "" , 0x00, 0x04, wxLayout_LeftToRight, "Javanese (Indonesia)","Basa Jawa (Indonesia)" },
|
||||
{ wxLANGUAGE_JAVANESE_JAVANESE, "jv-Java" , "jv@javanese" , "" , 0x00, 0x04, wxLayout_LeftToRight, "Javanese (Javanese)","\352\246\247\352\246\261\352\246\227\352\246\256" },
|
||||
{ wxLANGUAGE_JAVANESE_JAVANESE_INDONESIA, "jv-Java-ID" , "jv_ID@javanese" , "" , 0x00, 0x04, wxLayout_LeftToRight, "Javanese (Javanese, Indonesia)","\352\246\247\352\246\261\352\246\227\352\246\256 (Indon\303\251sia)" },
|
||||
{ wxLANGUAGE_JAVANESE_LATIN, "jv-Latn" , "jv@latin" , "" , 0x00, 0x04, wxLayout_LeftToRight, "Javanese","Basa Jawa" },
|
||||
{ wxLANGUAGE_JAVANESE_LATIN_INDONESIA, "jv-Latn-ID" , "jv_ID@latin" , "" , 0x00, 0x04, wxLayout_LeftToRight, "Javanese (Indonesia)","Basa Jawa (Indonesia)" },
|
||||
{ wxLANGUAGE_JOLA_FONYI, "dyo" , "dyo" , "dyo_SN" , 0x00, 0x04, wxLayout_LeftToRight, "Jola-Fonyi","joola" },
|
||||
{ wxLANGUAGE_JOLA_FONYI_SENEGAL, "dyo-SN" , "dyo_SN" , "" , 0x00, 0x04, wxLayout_LeftToRight, "Jola-Fonyi (Senegal)","joola (Senegal)" },
|
||||
{ wxLANGUAGE_KABUVERDIANU, "kea" , "kea" , "kea_CV" , 0x00, 0x04, wxLayout_LeftToRight, "Kabuverdianu","kabuverdianu" },
|
||||
|
|
@ -548,6 +546,7 @@ tabLangData[] =
|
|||
{ wxLANGUAGE_KAKO, "kkj" , "kkj" , "kkj_CM" , 0x00, 0x04, wxLayout_LeftToRight, "Kako","kak\311\224" },
|
||||
{ wxLANGUAGE_KAKO_CAMEROON, "kkj-CM" , "kkj_CM" , "" , 0x00, 0x04, wxLayout_LeftToRight, "Kako (Cameroon)","kak\311\224 (Kam\311\233run)" },
|
||||
{ wxLANGUAGE_KALAALLISUT, "kl" , "kl" , "kl_GL" , 0x6f, 0x01, wxLayout_LeftToRight, "Kalaallisut","kalaallisut" },
|
||||
{ wxLANGUAGE_KALAALLISUT_GREENLAND, "kl-GL" , "kl_GL" , "" , 0x6f, 0x01, wxLayout_LeftToRight, "Kalaallisut (Greenland)","kalaallisut (Kalaallit Nunaat)" },
|
||||
{ wxLANGUAGE_KALENJIN, "kln" , "kln" , "kln_KE" , 0x00, 0x04, wxLayout_LeftToRight, "Kalenjin","Kalenjin" },
|
||||
{ wxLANGUAGE_KALENJIN_KENYA, "kln-KE" , "kln_KE" , "" , 0x00, 0x04, wxLayout_LeftToRight, "Kalenjin (Kenya)","Kalenjin (Emetab Kenya)" },
|
||||
{ wxLANGUAGE_KAMBA, "kam" , "kam" , "kam_KE" , 0x00, 0x04, wxLayout_LeftToRight, "Kamba","Kikamba" },
|
||||
|
|
@ -587,7 +586,7 @@ tabLangData[] =
|
|||
{ wxLANGUAGE_KOYRABORO_SENNI_MALI, "ses-ML" , "ses_ML" , "" , 0x00, 0x04, wxLayout_LeftToRight, "Koyraboro Senni (Mali)","Koyraboro senni (Maali)" },
|
||||
{ wxLANGUAGE_KOYRA_CHIINI, "khq" , "khq" , "khq_ML" , 0x00, 0x04, wxLayout_LeftToRight, "Koyra Chiini","Koyra ciini" },
|
||||
{ wxLANGUAGE_KOYRA_CHIINI_MALI, "khq-ML" , "khq_ML" , "" , 0x00, 0x04, wxLayout_LeftToRight, "Koyra Chiini (Mali)","Koyra ciini (Maali)" },
|
||||
{ wxLANGUAGE_KURDISH, "ku-TR" , "ku_TR" , "" , 0 , 0 , wxLayout_LeftToRight, "Kurdish","Kurdî" },
|
||||
{ wxLANGUAGE_KURDISH, "ku-TR" , "ku_TR" , "" , 0 , 0 , wxLayout_LeftToRight, "Kurdish","Kurd\303\256" },
|
||||
{ wxLANGUAGE_KURDISH_ARABIC_IRAN, "ku-Arab-IR" , "ku_IR@arabic" , "" , 0x00, 0x04, wxLayout_RightToLeft, "Kurdish (Arabic, Iran)","\332\251\331\210\330\261\330\257\333\214 (\330\246\333\216\330\261\330\247\331\206)" },
|
||||
{ wxLANGUAGE_KWASIO, "nmg" , "nmg" , "nmg_CM" , 0x00, 0x04, wxLayout_LeftToRight, "Kwasio","Kwasio" },
|
||||
{ wxLANGUAGE_KWASIO_CAMEROON, "nmg-CM" , "nmg_CM" , "" , 0x00, 0x04, wxLayout_LeftToRight, "Kwasio (Cameroon)","Kwasio (Kamerun)" },
|
||||
|
|
@ -721,10 +720,11 @@ tabLangData[] =
|
|||
{ wxLANGUAGE_PASHTO, "ps" , "ps" , "ps_AF" , 0x63, 0x01, wxLayout_RightToLeft, "Pashto","\331\276\332\232\330\252\331\210" },
|
||||
{ wxLANGUAGE_PASHTO_AFGHANISTAN, "ps-AF" , "ps_AF" , "" , 0x63, 0x01, wxLayout_RightToLeft, "Pashto (Afghanistan)","\331\276\332\232\330\252\331\210 (\330\247\331\201\330\272\330\247\331\206\330\263\330\252\330\247\331\206)" },
|
||||
{ wxLANGUAGE_PASHTO_PAKISTAN, "ps-PK" , "ps_PK" , "" , 0x00, 0x04, wxLayout_RightToLeft, "Pashto (Pakistan)","\331\276\332\232\330\252\331\210 (\331\276\330\247\332\251\330\263\330\252\330\247\331\206)" },
|
||||
{ wxLANGUAGE_PERSIAN, "fa" , "fa" , "fa_IR" , 0x29, 0x01, wxLayout_RightToLeft, "Persian","\331\201\330\247\330\261\330\263\333\214" },
|
||||
{ wxLANGUAGE_PERSIAN_IRAN, "fa-IR" , "fa_IR" , "" , 0x29, 0x01, wxLayout_RightToLeft, "Persian (Iran)","\331\201\330\247\330\261\330\263\333\214 (\330\247\333\214\330\261\330\247\331\206)" },
|
||||
{ wxLANGUAGE_POLISH, "pl" , "pl" , "pl_PL" , 0x15, 0x01, wxLayout_LeftToRight, "Polish","polski" },
|
||||
{ wxLANGUAGE_POLISH_POLAND, "pl-PL" , "pl_PL" , "" , 0x15, 0x01, wxLayout_LeftToRight, "Polish (Poland)","polski (Polska)" },
|
||||
{ wxLANGUAGE_PORTUGUESE, "pt" , "pt" , "pt_PT" , 0x16, 0x01, wxLayout_LeftToRight, "Portuguese","portugu\303\252s" },
|
||||
{ wxLANGUAGE_PORTUGUESE, "pt" , "pt" , "pt_PT" , 0x16, 0x02, wxLayout_LeftToRight, "Portuguese","portugu\303\252s" },
|
||||
{ wxLANGUAGE_PORTUGUESE_ANGOLA, "pt-AO" , "pt_AO" , "" , 0x00, 0x04, wxLayout_LeftToRight, "Portuguese (Angola)","portugu\303\252s (Angola)" },
|
||||
{ wxLANGUAGE_PORTUGUESE_BRAZILIAN, "pt-BR" , "pt_BR" , "" , 0x16, 0x01, wxLayout_LeftToRight, "Portuguese (Brazil)","portugu\303\252s (Brasil)" },
|
||||
{ wxLANGUAGE_PORTUGUESE_CABO_VERDE, "pt-CV" , "pt_CV" , "" , 0x00, 0x04, wxLayout_LeftToRight, "Portuguese (Cabo Verde)","portugu\303\252s (Cabo Verde)" },
|
||||
|
|
@ -800,12 +800,12 @@ tabLangData[] =
|
|||
{ wxLANGUAGE_SENA, "seh" , "seh" , "seh_MZ" , 0x00, 0x04, wxLayout_LeftToRight, "Sena","sena" },
|
||||
{ wxLANGUAGE_SENA_MOZAMBIQUE, "seh-MZ" , "seh_MZ" , "" , 0x00, 0x04, wxLayout_LeftToRight, "Sena (Mozambique)","sena (Mo\303\247ambique)" },
|
||||
{ wxLANGUAGE_SERBIAN, "sr" , "sr" , "sr_RS" , 0x1a, 0x01, wxLayout_LeftToRight, "Serbian","srpski" },
|
||||
{ wxLANGUAGE_SERBIAN_CYRILLIC, "sr-Cyrl" , "sr@cyrillic" , "sr_RS" , 0x1a, 0x0a, wxLayout_LeftToRight, "Serbian (Cyrillic)","\321\201\321\200\320\277\321\201\320\272\320\270 (\320\213\320\270\321\200\320\270\320\273\320\270\321\206\320\260)" },
|
||||
{ wxLANGUAGE_SERBIAN_CYRILLIC, "sr-Cyrl" , "sr@cyrillic" , "" , 0x1a, 0x0a, wxLayout_LeftToRight, "Serbian (Cyrillic)","\321\201\321\200\320\277\321\201\320\272\320\270 (\320\213\320\270\321\200\320\270\320\273\320\270\321\206\320\260)" },
|
||||
{ wxLANGUAGE_SERBIAN_CYRILLIC_BOSNIA_AND_HERZEGOVINA, "sr-Cyrl-BA" , "sr_BA@cyrillic" , "" , 0x1a, 0x07, wxLayout_LeftToRight, "Serbian (Cyrillic, Bosnia and Herzegovina)","\321\201\321\200\320\277\321\201\320\272\320\270 (\320\221\320\276\321\201\320\275\320\260 \320\270 \320\245\320\265\321\200\321\206\320\265\320\263\320\276\320\262\320\270\320\275\320\260)" },
|
||||
{ wxLANGUAGE_SERBIAN_CYRILLIC_KOSOVO, "sr-Cyrl-XK" , "sr_XK@cyrillic" , "" , 0x00, 0x04, wxLayout_LeftToRight, "Serbian (Cyrillic, Kosovo)","\321\201\321\200\320\277\321\201\320\272\320\270 (\320\232\320\276\321\201\320\276\320\262\320\276)" },
|
||||
{ wxLANGUAGE_SERBIAN_CYRILLIC_MONTENEGRO, "sr-Cyrl-ME" , "sr_ME@cyrillic" , "" , 0x1a, 0x0c, wxLayout_LeftToRight, "Serbian (Cyrillic, Montenegro)","\321\201\321\200\320\277\321\201\320\272\320\270 (\320\246\321\200\320\275\320\260 \320\223\320\276\321\200\320\260)" },
|
||||
{ wxLANGUAGE_SERBIAN_CYRILLIC_SERBIA, "sr-Cyrl-RS" , "sr_RS@cyrillic" , "" , 0x1a, 0x0a, wxLayout_LeftToRight, "Serbian (Cyrillic, Serbia)","\321\201\321\200\320\277\321\201\320\272\320\270 (\320\241\321\200\320\261\320\270\321\230\320\260)" },
|
||||
{ wxLANGUAGE_SERBIAN_CYRILLIC_YU, "sr-Cyrl-YU" , "sr_YU@cyrillic" , "sr_YU" , 0x1a, 0x03, wxLayout_LeftToRight, "Serbian (Cyrillic)","српски (Србија)" },
|
||||
{ wxLANGUAGE_SERBIAN_CYRILLIC_YU, "sr-Cyrl-YU" , "sr_YU@cyrillic" , "" , 0x1a, 0x03, wxLayout_LeftToRight, "Serbian (Cyrillic)","\321\201\321\200\320\277\321\201\320\272\320\270 (\320\241\321\200\320\261\320\270\321\230\320\260)" },
|
||||
{ wxLANGUAGE_SERBIAN_LATIN, "sr-Latn" , "sr@latin" , "" , 0x1a, 0x09, wxLayout_LeftToRight, "Serbian (Latin)","srpski (latinica)" },
|
||||
{ wxLANGUAGE_SERBIAN_LATIN_BOSNIA_AND_HERZEGOVINA, "sr-Latn-BA" , "sr_BA@latin" , "" , 0x1a, 0x06, wxLayout_LeftToRight, "Serbian (Latin, Bosnia and Herzegovina)","srpski (Bosna i Hercegovina)" },
|
||||
{ wxLANGUAGE_SERBIAN_LATIN_KOSOVO, "sr-Latn-XK" , "sr_XK@latin" , "" , 0x00, 0x04, wxLayout_LeftToRight, "Serbian (Latin, Kosovo)","srpski (Kosovo)" },
|
||||
|
|
@ -1034,6 +1034,7 @@ tabScriptData[] =
|
|||
{ "Cher", "cherokee" },
|
||||
{ "Chrs", "chorasmian" },
|
||||
{ "Copt", "coptic" },
|
||||
{ "Cpmn", "cypro_minoan" },
|
||||
{ "Cprt", "cypriot" },
|
||||
{ "Cyrl", "cyrillic" },
|
||||
{ "Deva", "devanagari" },
|
||||
|
|
@ -1114,6 +1115,7 @@ tabScriptData[] =
|
|||
{ "Orya", "oriya" },
|
||||
{ "Osge", "osage" },
|
||||
{ "Osma", "osmanya" },
|
||||
{ "Ougr", "old_uyghur" },
|
||||
{ "Palm", "palmyrene" },
|
||||
{ "Pauc", "pau_cin_hau" },
|
||||
{ "Perm", "old_permic" },
|
||||
|
|
@ -1156,8 +1158,11 @@ tabScriptData[] =
|
|||
{ "Thai", "thai" },
|
||||
{ "Tibt", "tibetan" },
|
||||
{ "Tirh", "tirhuta" },
|
||||
{ "Tnsa", "tangsa" },
|
||||
{ "Toto", "toto" },
|
||||
{ "Ugar", "ugaritic" },
|
||||
{ "Vaii", "vai" },
|
||||
{ "Vith", "vithkuqi" },
|
||||
{ "Wara", "warang_citi" },
|
||||
{ "Wcho", "wancho" },
|
||||
{ "Xpeo", "old_persian" },
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue