Internationalization
Moderator: Forum Moderators
Internationalization
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
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
French translation
Hi,
Is there any french version if the game?
If not, I'm candidate to a French translation.
Regards.
Guillaume
Is there any french version if the game?
If not, I'm candidate to a French translation.
Regards.
Guillaume
French translation
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
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
Danish translation
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?
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 -
Dialog text
I'm pretty confused about how to translate the text in the dialogs...
Could u clarify this a bit?
Could u clarify this a bit?
- dk_skovbaer -
gettext ?
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.
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.
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
[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
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
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
About the Danish translation
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?
across the word "Revenant"... Is it possible for you (Dave) or
anyone else to explain this word to me?
- dk_skovbaer -