Internationalization

Discuss and coordinate development of mainline and user-made content translations.

Moderator: Forum Moderators

Post Reply
Dave
Founding Developer
Posts: 7071
Joined: August 17th, 2003, 5:07 am
Location: Seattle
Contact:

Internationalization

Post by Dave »

I have implemented a system that allows easier internationalization of the game.

A development version is available at http://www.kalikokottage.com/wesnoth/we ... 3.5.tar.gz which implements this.

All in-game dialogs have been moved to configuration files.

The configuration file english.cfg in the data directory contains the english language configuration. To translate the game to another language, e.g. Spanish, an equivalent file called spanish.cfg could be created, it included in the main game.cfg file using a {spanish.cfg} command, next to the {english.cfg} command, and then the text in the file converted to Spanish.

Additionally, the text displayed in dialogs can be overrwritten. For instance, the code,

[message]
id=msg1_1
speaker=narrator
message="Fourteen years after Asheviere began her reign, she turned her attention to the Elves, whom she despised. Orcish mercenaries were hired and dispatched to bring about the ruin of the Elves."
[end]

is used early in the scenario1.cfg file to denote the first message that appears in the game. Since this message is in English, the English configuration file doesn't override it. In the Spanish configuration file, you would use,

msg1_1="Catorce años después de que Asheviere comenzó su reinado, ella dio vuelta a su atención al Elves, que ella desdeñó. Los mercenaries de Orcish fueron empleados y enviados para causar la ruina del Elves."

to override that dialog.

Parts of the introductory sequence, and objects also have ids and they can be overridden in the same way.

Scenarios can be renamed using the id of the scenario:

scenario1="Panorama 1: El Elves sitió"

And the objectives of the scenario,

scenario1_objectives="..."

Units can be renamed simply by using their names with the spaces removed and assigning it to the new name. For instance,

GreatMage="Gran Mago"

Weapon names can be overridden using, for instance,

weapon_name_sword="espada"

weapon types similiarly,

weapon_type_pierce="perfore"

and weapon special attributes,

weapon_special_poison="veneno"

A unit ability can be overridden also,

ability_leadership="dirección"

It would probably be possible to write a tool which extracts all the possible things to translate from the game, and place all the keys into a file, ready to go. I may see about doing this at some point...

I think that's all. Comments on how we might improve this are welcome!

David
fmunoz
Founding Artist
Posts: 1469
Joined: August 17th, 2003, 10:04 am
Location: Spain
Contact:

Post by fmunoz »

Sweet,

but the trnaslation to spanish is better done by me ;-)

Un saludo
Paco
Guillaume
Posts: 103
Joined: August 25th, 2003, 12:11 pm
Location: France
Contact:

French translation

Post by Guillaume »

Hi,

Is there any french version if the game?
If not, I'm candidate to a French translation.

Regards.
Guillaume
Dave
Founding Developer
Posts: 7071
Joined: August 17th, 2003, 5:07 am
Location: Seattle
Contact:

Post by Dave »

Guillaume,

There is currently no French translation. You are welcome to do one if you would like.

David
Guillaume
Posts: 103
Joined: August 25th, 2003, 12:11 pm
Location: France
Contact:

French translation

Post by Guillaume »

Hi,

I created a french.cfg file which translate the UI.
The problem is that when specifying french.cfg in the game.cfg file,
the game starts but the button are empty (the buttons displayed but with no text in). What did I do wrong?
I used the 0.4 windows version of BFW.
How can I send this file it to you?

Regards.
Guillaume
Dave
Founding Developer
Posts: 7071
Joined: August 17th, 2003, 5:07 am
Location: Seattle
Contact:

Post by Dave »

Guillaume,

You may send the file to me at davidnwhite at optusnet dot com dot au

I will look over it to see why the buttons aren't displayed.

David
skovbaer
Posts: 126
Joined: August 26th, 2003, 9:11 pm
Location: Stoevring, Denmark
Contact:

Danish translation

Post by skovbaer »

Here's the danish translation:

http://www.femgramskovbaerte.dk/test/danish.cfg.bz2

I noticed that the storyline text isn't placed in a language-specific file... Are you planning to do that? If so, should I then wait and translate those later, or would I just translate them now?
- dk_skovbaer -
skovbaer
Posts: 126
Joined: August 26th, 2003, 9:11 pm
Location: Stoevring, Denmark
Contact:

Dialog text

Post by skovbaer »

I'm pretty confused about how to translate the text in the dialogs...
Could u clarify this a bit?
- dk_skovbaer -
zas
Posts: 54
Joined: August 25th, 2003, 9:58 pm
Location: France

gettext ?

Post by zas »

What about using GNU gettext tools for dialogs i18n ?
I don't know if it's overweighted nor how to add it to current C++ code.
But we use it for ELinks project i18n since some time, and it works cleanly, supporting formats (ie ."%02d %s"), and is quite used over open projects.

Or it's perhaps faster and simpler to have an internal i18n support...
I don't know enough about C++ and wesnoth code to tell more.
Dave
Founding Developer
Posts: 7071
Joined: August 17th, 2003, 5:07 am
Location: Seattle
Contact:

Post by Dave »

The way you do dialogs is that you go through each scenario file and if you see something like

[message]
description=Konrad
id=msg1_1
message="some text"
[end]

Then in your danish.cfg file, you put,

msg1_1="translation of 'some text' into Danish"

Note that you make changes in your danish.cfg file, and that is the ONLY file you have to create and edit to do your translation. (Except for having to add {danish.cfg} to game.cfg so it includes that file).

I'm afraid I'm not familiar with how GNU gettext works, however I am dubious about anything which involves formatting codes, since they are not type-safe. I think the current i18n system works fine.

David
Dave
Founding Developer
Posts: 7071
Joined: August 17th, 2003, 5:07 am
Location: Seattle
Contact:

Post by Dave »

Okay, I have prepared a sample translation file which can be used to aid translations:

http://wesnoth.whitevine.net/files/samp ... lation.cfg

If you get that file, and translate all the strings in it to your language, you will have created a translation.

There are still a couple of things (like weapon names) that are not included in that file. I will include a more comprehensive sample file at a later time.

David
miyo
Posts: 2201
Joined: August 19th, 2003, 4:28 pm
Location: Finland

Post by miyo »

One should be able to change Language from 'Preferences' while running the game.

- Miyo
ettin
Lord of Glamdrol
Posts: 369
Joined: August 17th, 2003, 2:05 pm
Contact:

Post by ettin »

I'm woking in the spanish translation.
Dave
Founding Developer
Posts: 7071
Joined: August 17th, 2003, 5:07 am
Location: Seattle
Contact:

Post by Dave »

ettin wrote:I'm woking in the spanish translation.
Cool. I hope you realize that the best place to work on a new translation from is now the sample_translation.cfg found with version 0.4.2.

David
skovbaer
Posts: 126
Joined: August 26th, 2003, 9:11 pm
Location: Stoevring, Denmark
Contact:

About the Danish translation

Post by skovbaer »

Having made quite a bit of Danish translation, I stumbled
across the word "Revenant"... Is it possible for you (Dave) or
anyone else to explain this word to me?
- dk_skovbaer -
Post Reply