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!














