Translation attempt

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

Moderators: Forum Moderators, Developers

Post Reply
User avatar
Seijo-ki
Posts: 9
Joined: May 10th, 2018, 6:19 pm

Translation attempt

Post by Seijo-ki » May 25th, 2018, 8:17 am

Hello!

I'm quite new in the developpment/translation part, so I never made a translation file myself. I already read the translation topics in the "Create" tab, but I didn't find anywhere how to generate a .po file to make the translation.
I downloaded poedit, but I don't have any .po file, so that I can translate my own campaign.

The translation topics are mostly about how translation works, and how to join the official wesnoth translation... which is not quite what I searched for.

Can someone help me out?

User avatar
Bitron
Moderator
Posts: 439
Joined: October 19th, 2015, 9:23 am
Location: Germany

Re: Translation attempt

Post by Bitron » May 25th, 2018, 8:51 am

You can download the .po files here
Those are the German files, you need to choose your language first, then click on the textdoman you want to translate, it will open a text file on your browser.
You can download it per right click. Remember to change the ending from .txt to .po.

User avatar
octalot
Code Contributor
Posts: 203
Joined: July 17th, 2010, 7:40 pm

Re: Translation attempt

Post by octalot » May 25th, 2018, 10:00 am

@Bitron - the question is for a UMC campaign, not the mainline campaigns.

The tool to use appears to be wmlxgettext, and knowing the tool name we can find the documentation on how to do it: viewtopic.php?f=8&t=46366#p617733

Knowing the tool name, we can also find out that there isn't up-to-date documentation on the Wiki. :(

User avatar
Bitron
Moderator
Posts: 439
Joined: October 19th, 2015, 9:23 am
Location: Germany

Re: Translation attempt

Post by Bitron » May 25th, 2018, 10:30 am

octalot wrote:
May 25th, 2018, 10:00 am
@Bitron - the question is for a UMC campaign, not the mainline campaigns.
Ah, my bad. Apologies.
I found this page after some research, maybe that helps.

User avatar
Seijo-ki
Posts: 9
Joined: May 10th, 2018, 6:19 pm

Re: Translation attempt

Post by Seijo-ki » May 25th, 2018, 1:52 pm

It worked nicely, thank you very much! :)

The cmd-code given in the forum-thread was wrong, because python3 isn't reconized as a command to call python. Just had to figure out that the 3 had to be erazed and everything was generated in seconds.

User avatar
GunChleoc
Translator
Posts: 440
Joined: September 28th, 2012, 7:35 am
Contact:

Re: Translation attempt

Post by GunChleoc » May 26th, 2018, 7:37 am

it depends on your python installation whether the command is python or python3. Maybe you can add that info to the wiki page for the next person?

User avatar
Celtic_Minstrel
Developer
Posts: 1225
Joined: August 3rd, 2012, 11:26 pm
Contact:

Re: Translation attempt

Post by Celtic_Minstrel » June 10th, 2018, 4:06 pm

For the record, if you install wmlxgettext into the correct location (a "utils" folder in the main Wesnoth directory), then you can use it through the GUI.pyw program in data/tools.
Author of The Black Cross of Aleron campaign and Default++ era.
Maintainer of Steelhive.

User avatar
Seijo-ki
Posts: 9
Joined: May 10th, 2018, 6:19 pm

Re: Translation attempt

Post by Seijo-ki » June 16th, 2018, 8:51 am

Well, now that it works fine, I don't think I need to change it.

I did my translation, but even if I have the ".PO" file and its compilation ".MO", the translation does not activate when I launch the campaign.
The directory inside main.cfg is the right one, but maybe the name of my translation files are wrong.
I didn't find any explanation on how to manage to make the game recognize your translation files.

Any ideas?

User avatar
Celtic_Minstrel
Developer
Posts: 1225
Joined: August 3rd, 2012, 11:26 pm
Contact:

Re: Translation attempt

Post by Celtic_Minstrel » June 16th, 2018, 5:32 pm

You can run Wesnoth with the --all-translations command-line option; then your translation should show up in the language selection list (provided the mo is in the correct location). Or you could use the --language=your-language command-line option. I think that would need the language abbreviation, eg "fr" for French.

There's also a file you can edit that will cause the translation to show up in the language selection list, but I'm not sure where that is. Somewhere in the Wesnoth data folder, probably.
Author of The Black Cross of Aleron campaign and Default++ era.
Maintainer of Steelhive.

User avatar
Seijo-ki
Posts: 9
Joined: May 10th, 2018, 6:19 pm

Re: Translation attempt

Post by Seijo-ki » June 17th, 2018, 1:06 pm

Command-line options?
In my campaign folder, I have my main.cfg and 3 scenario.cfg files. In the translation folder, I have a .PO file and a .MO file with the name "fr".
I only tryed to run Wesnoth normally with the game in french, then launching the campaign in single player, and watching if the translated dialogues would show up, instead of the english version.
This didn't happen. Maybe my MO and PO files are somewhat wrong or missing informations.

User avatar
James_The_Invisible
Posts: 463
Joined: October 28th, 2012, 1:58 pm
Location: Somewhere in the Northlands, fighting dark forces

Re: Translation attempt

Post by James_The_Invisible » June 17th, 2018, 2:09 pm

Seijo-ki wrote:
June 17th, 2018, 1:06 pm
In the translation folder, I have a .PO file and a .MO file with the name "fr".
That is probably the problem. The file should be named after your add-on's textdomain (wesnoth-something) and placed in translations/language/LC_MESSAGES (in this case fr).
Edit: It was brought to my attention that this name and path will work only for mo files. Separate po file should indeed be named after the language but should go to translations/your textdomain.

Post Reply