WesPo

Copyright © Nobun 2009-2014

License: GPL v3

 

Aug, 20, 2014: NEW version 2.2 is out!

Some improvements added. See changelog for more details


Wespo: an unofficial tool that will create a .po file for your wesnoth addon

Using WesPo is easy... Just browse your HD and select your add-on main directory; then press "create skele.po" and the file po (skele.po) will be created in your add-on main directory.
You can also check "Fuzzy" checkbox. If it is checked, every string included into skele.po will be marked as "fuzzy". If it is unchecked, every string included into skele.po will NOT be marked as fuzzy.

Wespo Shot 01


1. Linux / Mac release

Download sources from here, extract the .tar.gz archive and follow instructions into README file
Sources can be builded also un Mac (untested).

2. Windows release

A Windows binary is available here
Windows binary was crated on Ubuntu Linux using mingw - mxe. The binary is a little huge becouse is staticly builded (due to mxe restrictions). I would suggest you to download sources and compile (dinamicly) it, instead.
If you find that task too hard to you, simply use the prebuilded binary available.

2.1. Note for Windows8 and for Windows7

By default, Windows8 (and perhaps also Windows7, sometimes) forbid you to run any 3rd party software. In other words you will need to add an exception for wespo, if you really want to run it (because wespo is a recent 3rd party sofware, not related with Microsoft Store or Microsoft Certified Software).
WesPo is opensource, so it is a safe program. However, if you don't feel safe on using wespo, simply don't run it.

3. Advanced Features

WesPo, like the official wesnoth tool WesCamp, can create a good .po file with a lot of useful informations extracted from WML tags, like the speaker of a [message], or the unit type of a [side]. And also the filereference (/path/file: ROW)

Examples of WML informations:
1) (in macro definition: MACRO)
2) {MACRO ...}
3) [tag]: param1 = value; param2 = value;
4) [lua]:

case 1): the string was found inside the mainbody of a #define MACRO
case 2): the string was found in a MACRO call. Example {MACRO _"translate"}. In case of nested MACROS, it will be reported the MACRO that truely use the string: example = MACRO2 in a MacroCall {MACRO1 {MACRO2 _"translate"}}
case 3): the string was found in [tag]:
case 4): the string was found in [lua] tag or in luafile

Since WesPo cannot parse lua code to capture informations, the default information (only [lua]: ) could be too generic and too less helpful for a translator. This is where customizing information output becomes useful

3.1. Customizing automated information with # wespo:

An interesting feature, for a developer, is the chance to provide a custom information for a translatable string. It is important mainly if you put a translatable string inside a lua code

-- lua example
-- # wespo: [message]: speaker = Hero;
wesnoth.wml_actions.message ...

In the example, you will replace the default and generic information ([lua]: ), with a more detailed information ([message]: speaker = Hero;)

syntax:
# <space> wespo: <space> <custom information for the next translatable string into the add-on textdomain>


The symbol # must be followed by exactly 0 or 1 space. Inside a luacode you will need to mark this as comment with -- (like the example)
Immediately after the keyword wespo: followed by exactly one space
and finally your custom information. This custom information will be applied to the next translatable string.
When applied, the program continue to follow normal rules, unless you added other # wespo: custom informations


example:
# wespo: custom information 1
# wespo: custom information 2
# wespo: custom information 3

In the example I loaded in memory 3 custom informations. The first one will be applied in the first translatable string found, the second one will be applied in the second translatable string found, and so on.
However it is not a good idea to put a lot of custom informations together if you don't really need for a reason. It is suggested, instead, to put only a single custom information rightly before the translatable string.

Sourcecode Documentation

If you are curious about wespo sourcecode and you want to know how it internally works, you can read the doxygen sourcecode documentation