-
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
- click on webhooks
- add new webhook with the url above
- 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
The .pot file in your languages directory will be updated by this 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 ) This will trigger weblate to recieve any new strings that you might have made in this release. Once they are translated you can either wait until the next release to merge them into the next release or create a point release with the translations merged in.
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