po and mo

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

Moderator: Forum Moderators

User avatar
hermestrismi
Posts: 626
Joined: February 6th, 2016, 11:28 pm
Location: Tunisia
Contact:

po and mo

Post by hermestrismi »

what is the difference between .mo files and .po?
and where can I get .po?
(https://www.wesnoth.org/gettext/?view=l ... er&lang=ar had only links and not clear .po files)
User avatar
hermestrismi
Posts: 626
Joined: February 6th, 2016, 11:28 pm
Location: Tunisia
Contact:

Re: po and mo

Post by hermestrismi »

I downloaded the pages as saved page and changed extension from .txt to .po
is it that?
User avatar
Atreides
Posts: 1074
Joined: March 30th, 2019, 10:38 pm
Location: On the 2nd story of the centre village of Merwuerdigliebe turning the lights on and off

Re: po and mo

Post by Atreides »

I think there is also a way to turn .mo into .po. It was some Linux program. I did something like that a while back but I can't recall the details anymore.
User avatar
egallager
Posts: 583
Joined: November 19th, 2020, 7:27 pm
Location: Concord, New Hampshire
Contact:

Re: po and mo

Post by egallager »

Atreides wrote: May 1st, 2022, 10:46 pm I think there is also a way to turn .mo into .po. It was some Linux program. I did something like that a while back but I can't recall the details anymore.
yeah it's msgunfmt which is part of the gettext suite of tools: https://www.gnu.org/software/gettext/ma ... Invocation
User avatar
octalot
General Code Maintainer
Posts: 786
Joined: July 17th, 2010, 7:40 pm
Location: Austria

Re: po and mo

Post by octalot »

The original .po files have comments, using msgunfmt to convert a .mo back to a .po will result in something that doesn't have comments.

Welcome to the translators. I'd recommend only translating the 1.16 branch, the place to get .po files from is the 1.16 ("branch") version of that page: https://www.wesnoth.org/gettext/?view=l ... ch&lang=ar

There are some bugs in handling of right-to-left languages, for example #5600. That can be fixed on the 1.16 branch (it can be fixed because it doesn't break interoperability), and if we have an active Arabic translator then that bug will treated as higher priority.
User avatar
hermestrismi
Posts: 626
Joined: February 6th, 2016, 11:28 pm
Location: Tunisia
Contact:

Re: po and mo

Post by hermestrismi »

octalot wrote: May 2nd, 2022, 5:33 am The original .po files have comments, using msgunfmt to convert a .mo back to a .po will result in something that doesn't have comments.

Welcome to the translators. I'd recommend only translating the 1.16 branch, the place to get .po files from is the 1.16 ("branch") version of that page: https://www.wesnoth.org/gettext/?view=l ... ch&lang=ar

There are some bugs in handling of right-to-left languages, for example #5600. That can be fixed on the 1.16 branch (it can be fixed because it doesn't break interoperability), and if we have an active Arabic translator then that bug will treated as higher priority.
Hi. I already started but it will take time since there is almost 100% to translate and arabic language is really hard enough so no promises but I will do what I can
User avatar
hermestrismi
Posts: 626
Joined: February 6th, 2016, 11:28 pm
Location: Tunisia
Contact:

Re: po and mo

Post by hermestrismi »

hi
when you translate, do you keep the variable names
like from 'Loaded referenced map file:
$new' to
'ملف الخريطة المشار إليه الذي تم تحميله:
$new'
or you translate them as well?
User avatar
octalot
General Code Maintainer
Posts: 786
Joined: July 17th, 2010, 7:40 pm
Location: Austria

Re: po and mo

Post by octalot »

Keep them - when the string is displayed, the engine will replace $new with the actual filename. It needs the original variable name, otherwise it won't know what to replace.

The engine won't complain if you omit the variable entirely. For strings such as "Should $name pick up the sword?", some languages need to know the gender of the unit, and so their translators rephrased it in a way that didn't include the unit at all.
User avatar
hermestrismi
Posts: 626
Joined: February 6th, 2016, 11:28 pm
Location: Tunisia
Contact:

Re: po and mo

Post by hermestrismi »

I am asking because while I can easly know viariables by the $ sign, I don't know if sentences like '-name:' are variables or not.
sorry, but again , I send the finished file to who? I didn't found a proper thread and no arabic translator is available
User avatar
octalot
General Code Maintainer
Posts: 786
Joined: July 17th, 2010, 7:40 pm
Location: Austria

Re: po and mo

Post by octalot »

Please quote the exact string that you're asking about. It doesn't sound like a variable, but it sounds odd too.

As you're the only arabic translator, you're the translation maintainer and should send your files directly to Ivanovic, WesnothTranslationsHowTo#How_to_submit_your_translations. He collects the files and uploads all the ones he received each Saturday afternoon; he'll also run merge tools if the .po file isn't based on the latest version of the .pot file.
User avatar
hermestrismi
Posts: 626
Joined: February 6th, 2016, 11:28 pm
Location: Tunisia
Contact:

Re: po and mo

Post by hermestrismi »

octalot wrote: June 15th, 2022, 8:47 am Please quote the exact string that you're asking about. It doesn't sound like a variable, but it sounds odd too.

As you're the only arabic translator, you're the translation maintainer and should send your files directly to Ivanovic, WesnothTranslationsHowTo#How_to_submit_your_translations. He collects the files and uploads all the ones he received each Saturday afternoon; he'll also run merge tools if the .po file isn't based on the latest version of the .pot file.
yes, it is from https://www.wesnoth.org/gettext/.
I found things like

Code: Select all

name:
,

Code: Select all

type:
so, that made me uncertain
also, if I translate a sentence, do that automatically translate the same word at all .po files when open them (i use PoEdiit)
User avatar
octalot
General Code Maintainer
Posts: 786
Joined: July 17th, 2010, 7:40 pm
Location: Austria

Re: po and mo

Post by octalot »

Code: Select all

Name:

Type:
If we were adding those now, we'd probably make them more specific and add translation hints. They're displayed as-is to the user, so should be translated, but get reused for filenames, unit descriptions, and the tooltips that can appear when hovering over units in the scenario editor.
hermestrismi wrote: June 15th, 2022, 9:59 am also, if I translate a sentence, do that automatically translate the same word at all .po files when open them (i use PoEdiit)
It doesn't, but PoEdit has a list of suggestions that are populated from previous translations. So after you translate it once, that will appear as a suggestion in the top-right pane of PoEdit when editing other files.
User avatar
hermestrismi
Posts: 626
Joined: February 6th, 2016, 11:28 pm
Location: Tunisia
Contact:

Re: po and mo

Post by hermestrismi »

octalot wrote: June 15th, 2022, 10:56 am

Code: Select all

Name:

Type:
If we were adding those now, we'd probably make them more specific and add translation hints. They're displayed as-is to the user, so should be translated, but get reused for filenames, unit descriptions, and the tooltips that can appear when hovering over units in the scenario editor.
hermestrismi wrote: June 15th, 2022, 9:59 am also, if I translate a sentence, do that automatically translate the same word at all .po files when open them (i use PoEdiit)
It doesn't, but PoEdit has a list of suggestions that are populated from previous translations. So after you translate it once, that will appear as a suggestion in the top-right pane of PoEdit when editing other files.
right. i see now.
thank you
another question :lol: :lol:
how can I test my .po?
(and why all files have the same name when download them (ar.po)? I change them for exemple to wesnoth-editor_ar.po but certainly this not the name the engine comprehend)
User avatar
octalot
General Code Maintainer
Posts: 786
Joined: July 17th, 2010, 7:40 pm
Location: Austria

Re: po and mo

Post by octalot »

hermestrismi wrote: June 15th, 2022, 11:32 am how can I test my .po?
(and why all files have the same name when download them (ar.po)? I change them for exemple to wesnoth-editor_ar.po but certainly this not the name the engine comprehend)
They all have the same name because the Gettext system uses the directory that they're in to decide which domain they correspond to, and the filename to decide which language they are. Edit: for .mo files, it's the other way round; it'll be translations/ar/LC_MESSAGES/wesnoth-editor.mo.

Three methods, any of which should work:
  • GettextForTranslators#Files_when_running_the_game Generate .mo files (there's an option in PoEdit to do that when saving) and replace the game's .mo file with the new one.
  • Replace the .po files in a full copy of the Wesnoth source, then use the build-tools to generate .mo files.
  • https://r.wesnoth.org/p672739 Delete the .mo files, put the new .po files in a place where the engine will find them (which isn't where they are in the full source).
User avatar
hermestrismi
Posts: 626
Joined: February 6th, 2016, 11:28 pm
Location: Tunisia
Contact:

Re: po and mo

Post by hermestrismi »

octalot wrote: June 15th, 2022, 11:46 am
hermestrismi wrote: June 15th, 2022, 11:32 am how can I test my .po?
(and why all files have the same name when download them (ar.po)? I change them for exemple to wesnoth-editor_ar.po but certainly this not the name the engine comprehend)
They all have the same name because the Gettext system uses the directory that they're in to decide which domain they correspond to, and the filename to decide which language they are.

Three methods, any of which should work:
  • Generate .mo files (there's an option in PoEdit to do that when saving) and replace the game's .mo file with the new one.
  • Replace the .po files in a full copy of the Wesnoth source, then use the build-tools to generate .mo files.
  • https://r.wesnoth.org/p672739 Delete the .mo files, put the new .po files in a place where the engine will find them (which isn't where they are in the full source).
my bad
I should read carefully .
Thank you very much for all those information and assistance
Post Reply