Translation Guide
Thank you for your interest in translating Paperback! This page walks you through how to start a new translation, how to keep it updated, and how to submit your work.
All translation files live in the po directory of the repository. The template is paperback.pot, and each language is stored as po/<lang>.po using the standard language code (for example: es, pt_BR, de).
Prerequisites
- gettext tools (
xgettext,msgmerge,msgfmt) on yourPATH, for merging and compiling translations. - Poedit (optional but recommended), a graphical editor for
.pofiles. Any text editor works too. - Git and a GitHub account to submit your work.
Starting a New Translation
- Fork the repository on GitHub and clone your fork locally:
git clone https://github.com/trypsynth/paperback.git
cd paperback
- Create a branch for your translation:
git checkout -b danish-translation
- Copy the template to create your language file:
cp po/paperback.pot po/da.po
-
Edit the header in your
.pofile with the correct language name, your name, and email. -
Translate the strings. Keep placeholders and shortcut markers intact (see Notes below). Poedit will highlight warnings and errors as you go.
-
Verify the file compiles cleanly:
msgfmt --check --verbose po/da.po
- Test your translation by recompiling Paperback and selecting it from the options dialog.
Updating an Existing Translation
When new strings are added to Paperback:
- Switch to your translation branch and pull the latest changes:
git checkout danish-translation
git pull origin danish-translation
- Sync with the upstream repository if you have not already:
git remote add upstream https://github.com/trypsynth/paperback.git # first time only
git fetch upstream
git merge upstream/master
- Merge new strings into your translation:
msgmerge -U po/da.po po/paperback.pot
-
Translate any new or fuzzy strings. Entries marked
fuzzyneed review; empty entries are brand new. -
Remove fuzzy markers once reviewed, then compile and test (same as steps 6 and 7 above).
Submitting Your Translation
- Commit your
.pofile and push:
git add po/da.po
git commit -m "Add Danish translation"
git push origin danish-translation
-
Open a pull request at https://github.com/trypsynth/paperback/compare. Make sure the fields are set correctly:
- base repository:
trypsynth/paperback - base:
master - head repository: your fork
- compare: your translation branch
- base repository:
If you prefer not to use Git, attach your .po file to an issue and we will merge it for you.
Notes
- Keyboard shortcuts: Keep the
\tand key name together. - Format strings: Keep
%s,%d, and similar placeholders exactly as they appear. - Ampersands (
&): Used for menu keyboard shortcuts. Choose different letters if the same key would appear twice in a menu. - Punctuation and spacing: Match the source string for ellipses, colons, and spacing so UI alignment stays consistent.
- Encoding: Files must be UTF-8 without a BOM.
.mofiles: Do not commit.mofiles. They are compiled at build time and are not needed in the repository.