A little tool made by me to create .po for your addon

Discussion of all aspects of the game engine, including development of new and existing features.

Moderator: Forum Moderators

Post Reply
User avatar
Code Contributor
Posts: 129
Joined: May 4th, 2009, 9:28 pm
Location: Italy

A little tool made by me to create .po for your addon

Post by Nobun »

When a person, like me, need to create a .po BEFORE uploading his addon (becouse in a early development stage and needs to mantain 2 or more languages for his own addon) it is totally unclear how to create a new empty .po to edit then with your translations. Infact I posted a question about it but the only solutions seems the upload .

So I decided to make a little tool to easily create a basic .po for your own wesnoth addon

I don't know if you can find it useful or useless. And I don't know if it is the right place to offer you my little application.

However... I made this little tool (license: Gpl v3 - Os: Windows, Linux, can be builded also in Mac).

Nice Things:
You can navigate folder searching your addon and create a base .po only pressing a button (very easy to use)

Bad Things:
It not contains a real parser so:

- cannot distinguish from different TextDomains: my program add all translatable strings regardless of the fact if referred to textdomain that needs your po or textdomain translated elsewhere

- cfg files are not "parsed" in a particular order. Simply my program search for all *.cfg file in addon folder and all subdirs (also nested ones), so it should be possible to have, for example, the strings of 2nd scenario before of the 1st one

- comments reports the source file information(s) for every string (ex: #: add-ons/FOLDER/_main.cfg:14) (and if more then one, all files and rows for that entry) but NOT the comment that says the type of addon (ex: #. [campaign] id=my_id)

- strings cannot use quotes in the middle of sentence, or will be truncated. Example

value = _ " string"
" string2"
value2 = ...

in this case my program will see only "string" as the entry to translate, so it necessary to write, for example

value = _ "string

value2 = ...

(if you want that wesnoth writes an empty line you can simply press space in the second "empty" line

I upload here the program for you. Let me know what you think about (if usefull or useless, if you can need it or not)
(148.45 KiB) Downloaded 201 times
Retired Developer
Posts: 1365
Joined: March 27th, 2004, 12:25 am
Location: Germany

Re: A little tool made by me to create .po for your addon

Post by torangan »

You know, there's wmlxgettext in the wesnoth source file, somewhere in utils/. What you can do: get a recent add on from WesCamp, copy the Makefile, campaign.def (edit it), config.status and the po/ directory without any .po(t) files. Now, if wmlxgettext is in your path, a simple call to make will create the .pot and msginit will create the .po files. Other steps to remember: en* will be "translated", copy another po with same plural forms over it and nb.po needs to be renamed to nb_NO.po.
WesCamp-i18n - Translations for User Campaigns:

Translators for all languages required: contact me. No geek skills required!
Post Reply