The Altaz Mariners (French Translation)
Moderator: Forum Moderators
- Bob_The_Mighty
- Posts: 870
- Joined: July 13th, 2006, 1:15 pm
The Altaz Mariners (French Translation)
I'm opening this thread on behalf of krotop who has made a start translating mine and jb's campaign The Altaz Mariners.
I know nothing about how translations work in Wesnoth, so I have a few general questions.
1. Is there any tools or methods we should know about?
2. How does one load a French version of the campaign rather than the English one?
3. How do we incorporate the translation into our add-on file structure?
Any help would be appreciated. The only general info I have found pertains to translating mainline content, so I'm in the dark about how it should work for add-ons.
One more thing. Due to the size of our campaign and the amount of dialogue, krotop has suggested we seek another translator to help complete the task. If there is anyone who fancies helping out please get in touch.
I know nothing about how translations work in Wesnoth, so I have a few general questions.
1. Is there any tools or methods we should know about?
2. How does one load a French version of the campaign rather than the English one?
3. How do we incorporate the translation into our add-on file structure?
Any help would be appreciated. The only general info I have found pertains to translating mainline content, so I'm in the dark about how it should work for add-ons.
One more thing. Due to the size of our campaign and the amount of dialogue, krotop has suggested we seek another translator to help complete the task. If there is anyone who fancies helping out please get in touch.
My current projects:
MP pirate campaign: The Altaz Mariners
RPG sequel: Return to Trent
MP stealth campaign: Den of Thieves
MP pirate campaign: The Altaz Mariners
RPG sequel: Return to Trent
MP stealth campaign: Den of Thieves
Re: The Altaz Mariners (French Translation)
Most of what you need to know is described here: http://wiki.wesnoth.org/WesCamp
Note that you don't really need to use WesCamp if you don't wish to, but you probably should unless you know how to deal with translation tools.
The compiled translation files go into your campaign's "translations" directory. Byspel for a French translation: "translations/fr/LC_MESSAGES/<textdomain>.mo"
Translations for UMC are loaded when whatever language is set as the preferred language. So, if the French translation is active, all UMC French translations will be loaded.
Note that you don't really need to use WesCamp if you don't wish to, but you probably should unless you know how to deal with translation tools.
The compiled translation files go into your campaign's "translations" directory. Byspel for a French translation: "translations/fr/LC_MESSAGES/<textdomain>.mo"
Translations for UMC are loaded when whatever language is set as the preferred language. So, if the French translation is active, all UMC French translations will be loaded.
- pyrophorus
- Posts: 533
- Joined: December 1st, 2010, 12:54 pm
Re: The Altaz Mariners (French Translation)
I think I can help here. Let me know how.Bob_The_Mighty wrote: One more thing. Due to the size of our campaign and the amount of dialogue, krotop has suggested we seek another translator to help complete the task. If there is anyone who fancies helping out please get in touch.
Friendly,
LS
HowTos: WML filtering, WML variables
- Bob_The_Mighty
- Posts: 870
- Joined: July 13th, 2006, 1:15 pm
Re: The Altaz Mariners (French Translation)
I don't quite follow this, do you know a good example of an add-on with translations that I can download and poke around in?Espreon wrote:The compiled translation files go into your campaign's "translations" directory. Byspel for a French translation: "translations/fr/LC_MESSAGES/<textdomain>.mo"
Excellent! I shall PM you shortly once I've got my head around how best to proceed.pyrophorus wrote: I think I can help here. Let me know how.
My current projects:
MP pirate campaign: The Altaz Mariners
RPG sequel: Return to Trent
MP stealth campaign: Den of Thieves
MP pirate campaign: The Altaz Mariners
RPG sequel: Return to Trent
MP stealth campaign: Den of Thieves
- pyrophorus
- Posts: 533
- Joined: December 1st, 2010, 12:54 pm
Re: The Altaz Mariners (French Translation)
I investigate myself on the topic, and maybe all this can be a bit more explained. (I hope Espreon will correct if I missed something).Bob_The_Mighty wrote:I don't quite follow this, do you know a good example of an add-on with translations that I can download and poke around in?Espreon wrote:The compiled translation files go into your campaign's "translations" directory. Byspel for a French translation: "translations/fr/LC_MESSAGES/<textdomain>.mo"
Wesnoth uses a standard GNU tool named gettext. The big picture is really simple: in the source code, one can mark the translatable strings pre-pending them with an underscore. Then, instead of using the string as it is, a function is called which returns instead the translated one, according to the application or system language setting. When available of course, if not, returns the original string. (OK, I know, things are not so simple, but I just want to describe the work-flow here. Full details can be found at:http://www.gnu.org/software/gettext/manual/)
Now the building of a localized application is a four stage process:
1- First: preparing source code. In Wesnoth, it's pre-pending an underscore to any translatable string and setting a #textdomain directive at the very beginning of each source file. (Look at the link given by Espreon above, it's explained with all details).
2- Run on the source code a tool which extracts translatable strings in a new .pot file. From this file are created several .po files, each related to a particular langage.
3- Translate the strings editing the .po files. They contains entries for each string like this one:
Code: Select all
#. [campaign]: id=Trinity
#: Trinity/_main.cfg:21
msgid "Easy"
msgstr "Facile"
4- compile this .po file to binary format (.mo file) and move it to a special folder in the path of your application. In Wesnoth, this is the "translation" folder. Look at one of those (in the mainline campaigns for instance) to see exactly where to create these folders. In the Trinity example above, the .mo file should be in:
../add_ons/Trinity/translations/fr/LC_MESSAGES/Trinity.mo
assuming the #textdomain directive is set to #textdomain wesnoth-Trinity in source files.
Run Wesnoth, clear the cache, and select correct language setting to test.
Then, assuming step one is complete, content designers have two ways to do things:
1-Do things by themselves.
2-Use the Wescamp facility.
Step two can be done with the wmlxgettext program which can be found in the tools folder of standard Wesnoth distribution. This is necessary because WML is not (yet ) a language known in gettext world, and some manipulations must be done on the code (expanding macros for instance) before extracting.
Instead, you can insert the key 'translate=true' in your .pbl file. The add_ons server will do that for you. Where are the .po files then ? On a SVN repository, sorted by language (http://gettext.wesnoth.org/), so anyone can work on translation. Nice, isn't it ?
Step four is rather easy: if you uses poedit, it creates automatically the .mo file each time you save your work. Then you move the .mo file in the right folder of your add_on, select the language in Wesnoth preferences and you're done. Next time you upload the add_on, the translation will be available. If using Wescamp, you must commit the .po file updated (but read carefully guidelines first, it's a team work here), and AFAICS, mysterious and devoted little dwarfs create the .mo file and put it directly in the right location on the add_on server. (Great!)
Updates.
One can imagine easily gettext uses the .mo file as a dictionary. In this dictionary, the search key is the original string itself. So if you change the original string in your code, translated strings related to can't be found any more. So you must extract changes, update the .po files, find the orphan translated strings and link them again to the new original. It can be a lot of work.
Extracting changes and updating .po files (without losing all previous work) is a little more tricky than creating files from scratch. So it's probably better to:
- Begin translation only when your add-on is mature.
- Use Wescamp facility: our tireless little dwarfs take care of updates too ! (Praise them with great praises !)
HTH,
LS
HowTos: WML filtering, WML variables
Re: The Altaz Mariners (French Translation)
The Era of Magic is a good example.Bob_The_Mighty wrote: I don't quite follow this, do you know a good example of an add-on with translations that I can download and poke around in?
Actually, it should be "wesnoth-Trinity.mo" since the textdomain is "wesnoth-Trinity". Also, I don't think flushing the cache is necessary on most setups.pyrophorus wrote: In the Trinity example above, the .mo file should be in:
../add_ons/Trinity/translations/fr/LC_MESSAGES/Trinity.mo
assuming the #textdomain directive is set to #textdomain wesnoth-Trinity in source files.
Run Wesnoth, clear the cache, and select correct language setting to test.
Well, actually, it's much easier to use the stuff from WesCamp to generate and manage the translation files. But of course, that stuff can really only be used on a Linux or other Unix-like system. If Bob really wishes to manage the translations himself, I'll gladly tell him.Step two can be done with the wmlxgettext program which can be found in the tools folder of standard Wesnoth distribution. This is necessary because WML is not (yet ) a language known in gettext world, and some manipulations must be done on the code (expanding macros for instance) before extracting.
Actually, either the add-on server insertion stuff never worked or it is broken. And since mordante/SkeletonCrew hasn't the time to fix it... yeah.If using Wescamp, you must commit the .po file updated (but read carefully guidelines first, it's a team work here), and AFAICS, mysterious and devoted little dwarfs create the .mo file and put it directly in the right location on the add_on server. (Great!)
Re: The Altaz Mariners (French Translation)
The insertion stuff is supposed to happen, but it has been broken for years. From what I can tell in the campaign server sources, they're all scripts on the server somewhere.