Translations - theRealCarneiro/pulsemeeter GitHub Wiki
Contributing Translations
Pulsemeeter supports multiple languages using GNU gettext. If you'd like to help by translating the app into your language, follow the steps below.
Directory Structure
All translation files are kept in the locale/
directory.
Each language has its own subdirectory, e.g.:
locale/
├── pt_BR/
│ └── LC_MESSAGES/
│ └── pulsemeeter.po
├── de/
│ └── LC_MESSAGES/
│ └── pulsemeeter.po
Creating a New Translation
Generate template file:
You can generate the template .pot
file by running:
python setup.py extract_messages
Create language file based on template:
Create the language file specifying the language e.g. pt_BR:
python setup.py init_catalog -l pt_BR
Update the translation file when there are changes:
To update the .po
files when there a changes in the code, specify the language e.g. pt_BR:
python setup.py update_catalog -l pt_BR
Compiling and testing
To compile the .po
files just run:
python setup.py compile_catalog
To test it, copy the language directory to $XDG_DATA_HOME/locale
:
cp -r locale/pt_BR $XDG_DATA_HOME/locale
Submitting
When contributing a translation, only submit the .po file.
The `.mo file (compiled version) should not be committed — it will be generated automatically at build time. This keeps the repository clean and avoids merge conflicts in binary files.
Open a pull request including just your .po
file under the appropriate locale directory.