Celestia/Internationalization

From v1.5, Celestia fully supports internationalization (often abbreviated as i18n). Celestia i18n is processed using gettext, a service that allows for translation between different languages.

All the strings used in the program can be translated. For each language, the list of strings and their translation is saved in a .po file.

Using Celestia in another language
Celestia should automatically change the language it uses based on the computer's language. However, if you do not want to switch your computer's language and region, you can specially open Celestia using the command line:

MacOS X

 * 1) Open Terminal.
 * 2) Change the directory using   to the directory that has Celestia (the Unix executable file).
 * 3) Type , where   refers to the language code, for example   being Spanish.
 * 4) Press Enter.

Windows

 * 1) Open Command Prompt (cmd.exe)
 * 2) Change the directory using   to the directory that has Celestia
 * 3) Type , where   is the language code, and press Enter
 * 4) Type   and press Enter

Getting .po files
The .po files can be downloaded from the Celestia GitHub repository or from the table in the 'Celestia translation overview' section below.

Editing .po files
The .po files can be edited using the following software:
 * Poedit: for MacOS, Linux and Windows.
 * KBabel: for KDE

Updating existing .po files
The already existing .po files for a language can easily be updated to the latest version by using the celestia.pot. In poEdit this can be done with the command "Catalog/Update from POT file". This results then in the program showing a list of removed and changed or newly introduced strings. But be advised that the creation date of the .po file internally is not updated. KBabel should also have such a mechanism.

Creating a new .po file

 * Download the celestia.pot file from the GitHub repository.
 * Rename it using the ISO 639-1 code of your language.
 * Edit it as described in the above 'Editing .po files' section.

Adding completed .po files to Celestia
Either:
 * Join https://www.transifex.com/celestia/celestia/ as your language translator and upload your file.
 * Create a new pull-request to our repository on Github
 * Or simply send .po files to someone of developers

Building internationalization files from the source in MS Windows

 * Follow the Celestia build for Win 32 platform as described in Celestia/Development/Win32 platform. It is assumed that Celestia's source is in "c:\celestia" and other programs are installed in c drive, too.
 * Install perl (e.g. ActivePerl) and POEdit for Windows
 * Add path for POEdit (e.g. C:\Program Files\Poedit\bin). This is for msgfmt.
 * Open Windows command console (cmd.exe)
 * Execute "C:\Program Files\Microsoft Visual Studio 9.0\VC\bin\vcvars32.bat"
 * Change directory with "cd C:\celestia\celestia\po" command
 * Run "perl translate_resources.pl". The translate_resources.pl script does:
 * translate resource files from po files -> src/celestia/rc/celestia_LL.rc
 * build dll files -> src/celestia/rc/celestia_LL.res -> locale/res_LL.dll
 * compile catalogs -> locale/LL/LC_MESSAGES/celestia[_constellations].mo

Building .txf font texture files
Celestia uses its own .txf font textures to display the OpenGL overlay text. Some non-Latin characters may be missing from the font textures wich are distributed with the standard Celestia package, though. In that case, please use the following process to build celestia .txf font textures from standard .ttf fonts:

ttf2txf -w 1048 -h 1048 -f codepoints_LL.txt -s 12 -o sans12_LL.txf font.ttf ttf2txf -w 1048 -h 1048 -f codepoints_LL.txt -s 14 -o sans14_LL.txf font.ttf ttf2txf -w 1048 -h 1048 -f codepoints_LL.txt -s 20 -o sansbold20_LL.txf font_bold.ttf
 * Download the txf utilities from http://www.shatters.net/~claurel/stuff/txfutil.tar.gz (dead link)
 * This link has source code for what are probably the same utilities.
 * Generate the .txf files:

This will create the following font textures which should be placed in the font/ dir:
 * sans12_LL.txf
 * sans14_LL.txf
 * sansbold20_LL.txf.

Note for Windows users:
 * A pre-compiled version of ttf2txf is available at: http://gvince.perso.sfr.fr/celestia/dev/ttf2txf.zip
 * The codepoints_LL.txt file is generated by running the translate_resources.pl perl script from the po/ dir. See Building internationalization files from the source in MS Windows section above.

Celestia translation overview
The translation process currently applies to Celestia 1.6.1 (development version).

>> Last celestia.pot file update: 2010-01-04

Other localizable files
The following files can be localized too: controls.txt, COPYING, demo.cel, guide.cel, start.cel. These files can be edited using a simple text editor. For UTF-8 encoding, please consider using, e.g., notepad++ Once the translation is completed, just rename the file as controls_LL.txt, COPYING_LL, demo_LL.cel, guide_LL.cel, start_LL.cel, where LL represents the ISO 639-1 code of your language. Once the translation is completed, these files can be sent to [mailto:team@celestia.space team@celestia.space].