Tutorial: How to use WMLgettext on Windows to make a .pot file for translating your Wesnoth UMC (actually, no nonsense, no technobabble)
Want to translate your UMC, or make it easier for others to translate, but struggle to make the template file? If you’re like me, you are not a Linux user yet, and all of the available tutorials may as well be written in another language already. GetText was made for Linux users after all, and it expects a level of computer literacy that us Windows users may not quite measure up to, so WMLgettext may seem no different.
But it’s actually far easier than they make it sound. Here is how you really use it.
You don’t need to know any Python, but you need Python installed to use WMLgettext. Make sure when you’re installing it, tick the “add to PATH” checkbox in the installer!
Find “GUI.pyw” in the folders of your preferred Wesnoth. It should be under \data\tools\ in its file location.
Shift + right-click on GUI.pyw, and select “Copy as path”
Open the Command Prompter. If you don’t know how to do this, use your Start search bar at the bottom of the screen and search for “cmd”. Its icon is mostly a black rectangle and it should be called either “cmd” or “Command Prompt”; choose to open this program.
Once the Command Prompt is open, type “python” (with no quotes), a space, then paste the text you copied earlier. For me, this would be python "C:\Program Files\Battle for Wesnoth 1.17.24\data\tools\GUI.pyw"
Press the Enter key.
If you have followed the instructions, a window titled “Maintenance Tools GUI” should have just popped up. This is what you’ve been looking for!
In Maintenance Tools GUI, click the tab called “wmlgettext”
Under “Working Directory”, click “Browse” and navigate to the add-on you want to translate. You don’t need to select a specific folder inside the add-on, just the main folder that all of the other folders are kept inside of. This points the program towards the entirety of the add-on you want to translate.
Under “Output Directory”, browse for your add-on’s “translations” folder. This will choose where the .pot file is placed when it’s complete, and it also creates a translations folder for you if you don’t already have one.
Under “Advanced options”, check “Filter textdomains”, and in its little box type in the textdomain of your add-on. This makes it so gettext only creates a template using text and documents specified under that textdomain, and is thus useful if your add-on uses multiple textdomains (ex. if it contains both an Era and a Campaign, and you want them to have different translation files).
Click the button with a triangular symbol that looks like a “play” button; when moused over, this button should say “Run wmlgettext”
Check your add-on’s translation folder once it’s finished running. There’s your long-awaited .pot file!
Here is how your screen would likely be looking if you were translating the Merry Christmas campaign.
If you already have completely memorized where GUI.pyw is kept, if you want you can skip steps 2 and 3, and during step 5 you can type in the file path instead of copy-pasting it. Now you can finally use your program of choice to translate your add-on! Happy translating!















