-
Notifications
You must be signed in to change notification settings - Fork 11
Setting up translation for plugin
- copy the translations.yml workflow from the starter plugin into your plugin/theme under .github/workfrows/translations.yml if it's not already there
- edit the translations.yml workflow where indicated in the file
- create a webhook on the repository, to fire when a push is made, with the url https://translate.disciple.tools/hooks/github
- Go to repository settings e.g. https://github.com/squigglybob/disciple-tools-prayer-campaigns/settings
- click on webhooks
- add new webhook with the url https://translate.disciple.tools/hooks/github ( You can use the default options other than the url )
- Send the following details to the weblate admin so that they can add your repository to the translation software
- name of the plugin/theme
- https url of your repository
- the name of your master branch ( if not master, e.g. main )
- location of your .pot file
flowchart TD
Developers:::green --1. release \(push e.g. 1.2.3 tag\)--> R([Repository])
R -. 2. Update translations .-> R
R --3. Pull--> W([Weblate])
W --4. Notifies-->T[Translators]:::green
T --5. Translate--> W
W --6. Push--> R
classDef green fill:#144C3E, color:#FFF
The .pot file in your languages directory will be updated by the translations workflow when a release of your plugin is made (unless you modified the workflow to run on a different trigger)
( A new release is triggered when a new *.* tag is pushed to the repo )
When the .pot file changes in the master branch, the webhook will notify weblate to pull the new translation changes from this release
Once they are translated in weblate, they will go into a PR that you can merge back into master when you are ready.
You can then either merge them in and create a point release with the translations merged in or just merge them in for the next release that you have planned.
Add new component to weblate with the details given for the repository.
Version Control System: Github Pull Request
Source Code repository: repo https url
Repository branch: master (or the branch given by the plugin maintainer)
Leave the push url and branch empty, so that weblate will create a PR from a fork that it will make.
Once weblate has successfully connected to the repo: Make sure that the mask is correct for where the translation files need to go. Double check that the "Template for new translations" points to the correct location of the .pot Make any other changes necessary.
After weblate has added the component: Add any Add-ons needed for this component
e.g.
- Machine Translation
- Add Weblate translation memory
- Add google translate
- Generate .mo files
- Update .po files to match .pot files
- The discipletoolsbot username and personal access token ( created at https://github.com/settings/tokens ) have been added to the env variables in the weblate docker container
- The weblate ssh key has been added to the discipletoolsbot ssh keys at https://github.com/settings/keys