-
Notifications
You must be signed in to change notification settings - Fork 161
GeoDa Internationalization Project
GeoDa Internationalization (I18n) and Localization(L10n) project aims to provide an online tool that GeoDa users could help to translate the GeoDa UI to different languages.
For crowdsourcing, we use Google Spreadsheet with the public address here. Anyone can access this spreadsheet, and edit the items of each translation.
Before every GeoDa release, a program will be used to download the spreadsheet, extract edits for verification, and merge valid edits into GeoDa's language packages.
One of the most classic tools for I18n and L10n is a Unix tool called Gettext, which is used in this project. There are three file types you usually deal with while working with Gettext. PO (Portable Object), MO (Machine Object) files and POT (PO Template) file.
I18n
|
├──lang
| ├──config.ini
| ├── es
│ | └── geoda.mo
| └── zh_CN
│ └── geoda.mo
|
├──profile
│ ├── es.mo
│ └── zh_CN.po
|
└── geoda.pot
The related files can be found under geoda_source_dir/internationalization.
The above example shows the name of directories following the Locale Code, which is simply a code that identifies one version of a language. It’s defined following the ISO 639-1 and ISO 3166-1 alpha-2 specs: two lower-case letters for the language, optionally followed by an underscore and two upper-case letters identifying the country or regional code.
To create a geoda.pot file, one can run the shell script under geoda_source_dir/internationalzation directory:
./create_geoda_pot.shThis script will go through all the *.cpp and *.h files under geoda_source_dir directory, and extract the strings coded in _() macro.
# create_geoda_pot.sh
# the first part will use find() command to find _() strings from
find .. \( -name '*.cpp' -o -name '*.h' \) -not -path "../BuildTools/*" | xargs xgettext -d geoda -s --keyword=_ -p ./ -o geoda.pot