po files parsing
Moderator: Forum Moderators
- hermestrismi
- Posts: 730
- Joined: February 6th, 2016, 11:28 pm
- Location: Tunisia
- Contact:
po files parsing
A translation question.
I want to begin to work for translating Wesnoth-manual and -manpages and there is a lot of confusing codes (almost every sentences is a test for me) . So, there a way to parse a .po file directly into the game to know if there is a translation incompatibility?
I want to begin to work for translating Wesnoth-manual and -manpages and there is a lot of confusing codes (almost every sentences is a test for me) . So, there a way to parse a .po file directly into the game to know if there is a translation incompatibility?
The Dark Master, The Dark Hordes (Unofficial version), Return of the Legion , Eternal Kingdom, An Elvish Scout,Unrest in Elfland , Hidden War ...
The Dark Master Project, Arabic tra. maintainer
"But he loves you" G. Carlin
The Dark Master Project, Arabic tra. maintainer
"But he loves you" G. Carlin
- Lord-Knightmare
- Discord Moderator
- Posts: 2475
- Joined: May 24th, 2010, 5:26 pm
- Location: Somewhere in the depths of Irdya, gathering my army to eventually destroy the known world.
- Contact:
Re: po files parsing
I dont know...but I think you can...use that software..."PoEdit"? To inspect this. I know it's a freemium, but I think you can compile a 100% free version from the poedit Github. I have not tried it, but the egallager person might know how.hermestrismi wrote: ↑October 31st, 2024, 1:24 pm A translation question.
I want to begin to work for translating Wesnoth-manual and -manpages and there is a lot of confusing codes (almost every sentences is a test for me) . So, there a way to parse a .po file directly into the game to know if there is a translation incompatibility?
Creator of "War of Legends"
Creator of the Isle of Mists survival scenario.
Maintainer of Forward They Cried
User:Knyghtmare | My Medium
Creator of the Isle of Mists survival scenario.
Maintainer of Forward They Cried
User:Knyghtmare | My Medium
Re: po files parsing
With -manpages and -manual, those textdomains aren't shown within the game inself. The files in -manpages are shown by the Unix
man
command, while -manual generates HTML to show in a web browser.- hermestrismi
- Posts: 730
- Joined: February 6th, 2016, 11:28 pm
- Location: Tunisia
- Contact:
Re: po files parsing
I use PoEdit among other utils altogether already but I didn't know there is a free version (it will help me if there is one) but it isn't sufficient. While PoEdit tell you if the sentence is 'equal' to the source, it doesn't tell if [ something ] or B-< something > is a code or a plain text. I m seeking for something to test directly the sentence looks after it is read by the gameLord-Knightmare wrote: ↑October 31st, 2024, 2:03 pm I dont know...but I think you can...use that software..."PoEdit"? To inspect this. I know it's a freemium, but I think you can compile a 100% free version from the poedit Github. I have not tried it, but the egallager person might know how.
Good to know. Is this mean I can create a html example and past the translated sentences to it?
The Dark Master, The Dark Hordes (Unofficial version), Return of the Legion , Eternal Kingdom, An Elvish Scout,Unrest in Elfland , Hidden War ...
The Dark Master Project, Arabic tra. maintainer
"But he loves you" G. Carlin
The Dark Master Project, Arabic tra. maintainer
"But he loves you" G. Carlin
Re: po files parsing
Assuming Debian or Ubuntu, this should generate the manual's HTML file to open in a browser:
If you have a full build environment,
Code: Select all
/usr/bin/po4a-translate -f docbook -L utf8 -m doc/manual/manual.en.xml -p po/wesnoth-manual/ar.po -l doc/manual/manual.ar.xml --keep 0
/usr/bin/xsltproc --nonet --stringparam callout.graphics 0 --stringparam navig.graphics 0 --stringparam admon.textlabel 1 --stringparam admon.graphics 0 --stringparam html.stylesheet ./styles/manual.css /etc/asciidoc/docbook-xsl/xhtml.xsl doc/manual/manual.ar.xml > doc/manual/manual.ar.html
scons update-po4a
should run that, although it will run it without the --keep 0
, which means that it will only generate the HTML file for languages that are a certain amount translated, by default 80%.- hermestrismi
- Posts: 730
- Joined: February 6th, 2016, 11:28 pm
- Location: Tunisia
- Contact:
Re: po files parsing
I published wesnoth-manual (70%) but I didn't find it in the Wiki of wesnoth. Is there something wrong?octalot wrote: ↑October 31st, 2024, 6:31 pm Assuming Debian or Ubuntu, this should generate the manual's HTML file to open in a browser:
If you have a full build environment,Code: Select all
/usr/bin/po4a-translate -f docbook -L utf8 -m doc/manual/manual.en.xml -p po/wesnoth-manual/ar.po -l doc/manual/manual.ar.xml --keep 0 /usr/bin/xsltproc --nonet --stringparam callout.graphics 0 --stringparam navig.graphics 0 --stringparam admon.textlabel 1 --stringparam admon.graphics 0 --stringparam html.stylesheet ./styles/manual.css /etc/asciidoc/docbook-xsl/xhtml.xsl doc/manual/manual.ar.xml > doc/manual/manual.ar.html
scons update-po4a
should run that, although it will run it without the--keep 0
, which means that it will only generate the HTML file for languages that are a certain amount translated, by default 80%.
The Dark Master, The Dark Hordes (Unofficial version), Return of the Legion , Eternal Kingdom, An Elvish Scout,Unrest in Elfland , Hidden War ...
The Dark Master Project, Arabic tra. maintainer
"But he loves you" G. Carlin
The Dark Master Project, Arabic tra. maintainer
"But he loves you" G. Carlin
Re: po files parsing
The default for po4a is to only generate documents once they're 80% translated, so it doesn't generate it yet, sorry.
I suspect that getting it listed on the Wiki will need Ivanovic or Pentarctagon to edit the Wiki page.
I suspect that getting it listed on the Wiki will need Ivanovic or Pentarctagon to edit the Wiki page.
- hermestrismi
- Posts: 730
- Joined: February 6th, 2016, 11:28 pm
- Location: Tunisia
- Contact:
Re: po files parsing
Thank you for the explanation. I will once I finish it. Right now, I want to congratulate myself for my ego needs some cheers

The Dark Master, The Dark Hordes (Unofficial version), Return of the Legion , Eternal Kingdom, An Elvish Scout,Unrest in Elfland , Hidden War ...
The Dark Master Project, Arabic tra. maintainer
"But he loves you" G. Carlin
The Dark Master Project, Arabic tra. maintainer
"But he loves you" G. Carlin