translating dtdocs
Translation of the darktable documentation is done via our Weblate instance.
You can either use Weblate’s web UI to translate the documentation or download the translation from Weblate to your computer, edit it, and then upload the changes.
Please do all translation work through Weblate. We will not accept pull requests directly on github to update PO files.
🔗Making a new branch in git
- Make a new branch to work on it in git.
For example:
git checkout -b fr-translation-init
🔗Adding a new language to Hugo
-
In the files
config.yaml
andconfig-pdf.yaml
, locate thelanguages:
line. -
Add the language you wish to translate. For example, the English looks like this:
en-us: title: darktable 3.4 user manual weight: 1
-
Save the files.
🔗Generating a PO file
Do the following steps if you want to update the POT and PO files from the markdown source.
- Create an empty PO file for your language in the
po
folder with the file namecontent.<language>.po
. For example:touch po/content.fr-fr.po
- Run the script to populate the PO file:
cd tools/ && ./generate-translations.sh --no-translations
🔗Generating translated files
Do the following steps to generate the website files from a translation.
- Generate the translated files:
cd tools/ && ./generate-translations.sh --no-update
. - Check the translation by starting hugo’s internal server:
hugo server
- Open a web browser and check the changes. The URL is in the output of the
hugo server
command. - Remove the translated files, as we never check them into git:
cd tools/ && ./generate-translations.sh --rm-translations
.
🔗Translating website, epub, and PDF strings
There are two themes for the darktable documentation: one for the HTML website and one for the PDF. You’ll need to translate the strings for both.
- Go to
themes/hugo-darktable-docs-themes/i18n
. - Copy content of the file
en.yaml
and name the new file<your language>.yaml
. - Translate the content of the new yaml file.
- Check the translated PO file into git, push it to github, and open a pull request to have your changes accepted.
- Repeat the last four steps for the other themes,
themes/hugo-darktable-docs-epub-theme
andthemes/hugo-darktable-docs-pdf-theme
.
🔗Integrating new translations from Weblate
The following assumes that you’re git working directory is clean, that you have API access to the Weblate instance, that you’ve configured the Weblate git repo as a remote in your local dtdocs
git repo, and that wlc
, the Weblate command line client, is configured.
- Commit any changes in Weblate:
wlc commit darktable/dtdocs
- Lock the Weblate project to prevent further changes:
wlc lock darktable/dtdocs
- In your local
dtdocs
git repo, create a new branch:git checkout -b po-updates
- Update the Weblate remote:
git remote update weblate
- Merge the Weblate changes into your locally created branch:
git merge weblate/master
- Squash all the Weblate commits, since there are so many:
git reset $(git merge-base master $(git rev-parse --abbrev-ref HEAD))
- Stage the changed PO files:
git add -A
- Commit the
PO
files:git commit -m "Updated with the PO files from weblate."
- Update the
POT
andPO
files:cd tools/ && ./generate-translations.sh --no-translations && cd ..
- Stage the
POT
andPO
files:git add -A
- Commit the
POT
andPO
files:git commit -m "Updated POT and PO files."
- Create a Pull Request in Github.
- After the Pull Request is accepted, reset the Weblate repo to match the
dtdocs
repo:wlc reset darktable/dtdocs