Translating Celestia

The place to discuss creating, porting and modifying Celestia's source code.
Topic author
Spirit
Posts: 12
Joined: 18.12.2007
With us: 16 years 11 months
Location: Stockholm, Sweden

Translating Celestia

Post #1by Spirit » 18.12.2007, 17:17

Hi, excuse me if this topic has already been discussed. I would like to translate Celestia in Bulgarian. Can you give me some guidelines how to do it? I have some coding experience in C++, but I have never worked with such large projects. I have Windows Vista Home Premium and Visual C++ 2008 Express Edition.

Thanks!

Christophe
Developer
Posts: 944
Joined: 18.07.2002
With us: 22 years 4 months
Location: Lyon (France)

Post #2by Christophe » 18.12.2007, 17:42

See this page for translation instructions.

Sadly there is no simple way to test your own translation under Windows short of setting up a full build system, and I'm not sure if Celestia builds with VC++ 2008 EE (can anybody confirm ?).

Otherwise, you can send me your .po files and I'll send you back the dll and mo files so that you can test it.
Christophe

Topic author
Spirit
Posts: 12
Joined: 18.12.2007
With us: 16 years 11 months
Location: Stockholm, Sweden

Post #3by Spirit » 18.12.2007, 17:59

May I have the following files in English, so that I can translate them:

1. celestia.pot: core, linux and win32 GUI, Solar System objects and Earth locations

3. Other files
- start.cel
- guide.cel
- demo.cel
- controls.txt

Only the second .po file is uploaded on the website that you provided. I start translating it.

PS I am a moderator in the Bulgarian Science Online Magazine forum and we get a lot of positive feedback regarding Celestia, so I decided to translate it since several users asked about a BG version.

Topic author
Spirit
Posts: 12
Joined: 18.12.2007
With us: 16 years 11 months
Location: Stockholm, Sweden

Post #4by Spirit » 18.12.2007, 18:45

OK, I got the files from point 3. Need only the first file with the core data.

Christophe
Developer
Posts: 944
Joined: 18.07.2002
With us: 22 years 4 months
Location: Lyon (France)

Post #5by Christophe » 18.12.2007, 19:03

The pot files are linked in the titles.
Christophe

Topic author
Spirit
Posts: 12
Joined: 18.12.2007
With us: 16 years 11 months
Location: Stockholm, Sweden

Post #6by Spirit » 18.12.2007, 21:31

I translated the file START.CEL and replaced it with the one in the Celestia main directory, but I get the following error:

Image

What's wrong? Here is the content of START.CEL:

[code]{
# ... ?

Vincent
Developer
Posts: 1356
Joined: 07.01.2005
With us: 19 years 10 months
Location: Nancy, France

Post #7by Vincent » 18.12.2007, 22:03

Spirit,

You need to save your start.cel file using the UTF-8 format.
If your text editor doesn't give you this option, you can use, e.g., notepad2: http://www.flos-freeware.ch/notepad2.html (Choose UTF-8 encoding from the File>Encoding Menu)
@+
Vincent

Celestia Qt4 SVN / Celestia 1.6.1 + Lua Edu Tools v1.2
GeForce 8600 GT 1024MB / AMD Athlon 64 Dual Core / 4Go DDR2 / XP SP3

Topic author
Spirit
Posts: 12
Joined: 18.12.2007
With us: 16 years 11 months
Location: Stockholm, Sweden

Post #8by Spirit » 19.12.2007, 05:19

I traced the problem back to a rear Cyrillic symbol that I used. Now I have to translate the rest. It's time for work :D

Topic author
Spirit
Posts: 12
Joined: 18.12.2007
With us: 16 years 11 months
Location: Stockholm, Sweden

Post #9by Spirit » 19.12.2007, 14:07

OK, already translated bg.po and bg.pot. They are accessible here both in a single ZIP file.

I am working on the scripts now. Already completed start.cel and guide.cel.

I will appreciate any help and further instructions.

Thanks!

Topic author
Spirit
Posts: 12
Joined: 18.12.2007
With us: 16 years 11 months
Location: Stockholm, Sweden

Post #10by Spirit » 19.12.2007, 16:10

I translated it :D Well, at least some 99%. The rest I will do during the testing. I have the following files in Bulgarian:

bg.po
bg.pot
controls.txt
COPYING
guide.cel
start.cel

They are accessible from the bg.zip file. But I have some problems with them. The script files don't print Cyrillic characters in Celestia. I can only see the dots and commas. Tried different encoding charts. Current is UTF-8. controls.txt and COPYING work only with ANSI encoding (that is not a problem - it works). And bg.po and bg.pot are with UTF-8 encoding.

I hope that we could fix the problem and get the first test version of Celestia in Bulgarian. I am planning to upload it on the BG Science website and invite the guys from the forums I write in to help me test and improve the translation.

Hopefully it will work and we will have a nice translation of Celestia in Bulgarian.

Thanks!

Best regards,
Atanas Kumbarov

Christophe
Developer
Posts: 944
Joined: 18.07.2002
With us: 22 years 4 months
Location: Lyon (France)

Post #11by Christophe » 19.12.2007, 16:39

The correct encoding to use is UTF-8 for all files.

The problem you're seeing is that the default texture fonts do not include Cyrillic characters.

There's an online tool available here to produce new texture fonts.

First you need to produce a new codepoint file, you can start from the default WGL4 one, and simply add the list of Unicode code points required by Cyrillic. You can browse the Unicode table here, that will probably be a subset of the 0400-0513 range.

You then have to produce a 12pts and 20pts bold version of the font.

Then save the txf files produced in the fonts\ directory of your Celestia installation as "sans12_bg.txf" and ""sansbold20_bg.txf".
Christophe

Topic author
Spirit
Posts: 12
Joined: 18.12.2007
With us: 16 years 11 months
Location: Stockholm, Sweden

Post #12by Spirit » 19.12.2007, 16:54

A couple of questions:

1. What TTF font file should I use?
2. Where do I get the default WGL4 file from? I searched my HDD and found nothing.

Thanks!

Christophe
Developer
Posts: 944
Joined: 18.07.2002
With us: 22 years 4 months
Location: Lyon (France)

Post #13by Christophe » 19.12.2007, 16:58

Hum, it looks like my font tool is not working, I haven't restored it after my last server reinstall. I'll try and fix it quickly.
Christophe

Christophe
Developer
Posts: 944
Joined: 18.07.2002
With us: 22 years 4 months
Location: Lyon (France)

Post #14by Christophe » 19.12.2007, 17:03

Spirit wrote:1. What TTF font file should I use?
2. Where do I get the default WGL4 file from? I searched my HDD and found nothing.


You can use any font which includes Cyrillic glyphs. Arial should do.

The WGL4 file is linked in the Guide section of the texture generator page.
Christophe

Christophe
Developer
Posts: 944
Joined: 18.07.2002
With us: 22 years 4 months
Location: Lyon (France)

Post #15by Christophe » 19.12.2007, 17:32

ok, it's working now.
Christophe

Topic author
Spirit
Posts: 12
Joined: 18.12.2007
With us: 16 years 11 months
Location: Stockholm, Sweden

Post #16by Spirit » 19.12.2007, 17:44

All files -> UTF-8...
Created sans12_bg.txf...
Created sansbold20_bg.txf...
Copied to fonts directory...
Tested...
Result: no text

All files: bgwithfonts.zip

PS Added 0400 to 04FF in WGF4.

Christophe
Developer
Posts: 944
Joined: 18.07.2002
With us: 22 years 4 months
Location: Lyon (France)

Post #17by Christophe » 19.12.2007, 17:50

The texture size you chose is too small, you can check that using the preview fonction.

For example, here it what it gives for your sansbold20_bg.txf file:
Image

as you can see, it is truncated and many characters are missing.
Christophe

Topic author
Spirit
Posts: 12
Joined: 18.12.2007
With us: 16 years 11 months
Location: Stockholm, Sweden

Post #18by Spirit » 19.12.2007, 18:04

I have the textures large and I can see all characters including the Cyrillic subset, but it still does not work.

The new TXF files: fonts.zip

Christophe
Developer
Posts: 944
Joined: 18.07.2002
With us: 22 years 4 months
Location: Lyon (France)

Post #19by Christophe » 19.12.2007, 19:07

Not working too badly:
Image

The font is selected from the language code indicated in the catalog file, so you need to have your catalog compiled and installed for the automatic font selection to work.

Otherwise you can set the fonts manualy in celestia.cfg.

In the future, please use a po editor to translate the pot files, your po had several syntax errors.

The i18n page also indicates that "LANGUAGE" and "WinLangID" must be set to special values, that wasn't the case in your file.

I'll publish the windows dll and mo files here later tonight or tomorrow night.
Christophe

Christophe
Developer
Posts: 944
Joined: 18.07.2002
With us: 22 years 4 months
Location: Lyon (France)

Post #20by Christophe » 20.12.2007, 23:08

I've uploaded updated localization files for Windows for all languages here.

Simply unzip in your main installation directory and start Celestia normaly.

Let me know if it's working for you.
Last edited by Christophe on 21.12.2007, 08:14, edited 1 time in total.
Christophe


Return to “Development”