This guide explains the different tasks ioBroker Weblate administrators need to perform.
The following prerequisites must be met before an adapter can be added to Weblate:
- The adapter must contain the i18n files in a separate folder with the default naming scheme
- If the adapter is using
gulp
, ensure all files are up-to-date by callinggulp translateAndUpdateWordsJS
and commit and push those changes - If the adapter is using
@iobroker/adapter-dev
, ensure all files are up-to-date by callingnpm run translate all
and commit and push those changes to master
- Navigate to https://weblate.iobroker.net/projects/adapters/ and click on "Add new translation component" located at the bottom of the page. Do NOT use "Add new translation project"
- Provide the following input:
- Component name: Name of the adapter in lowercase without "ioBroker." (Example:
loxone
for the adapter ioBroker.loxone) - URL slug: same as component name above - do not shorten it!
- Project: leave at
ioBroker Adapters
- Version control system: change to
GitHub pull request
- Source repository: HTTPS URL of the repository (Example:
https://github.com/UncleSamSwiss/ioBroker.loxone
) - Repository branch: always the default branch (in most of the cases this is
master
ormain
)
- Component name: Name of the adapter in lowercase without "ioBroker." (Example:
- Start the detection by clicking on "Continue"
- Choose translation files to import:
- File format is always
JSON file
- Filemask is similar to
admin/i18n/*/translations.json
- File format is always
- Click on "Continue"
- Review the settings and update the following (everything else should be ok as it is):
- Repository browser:
https://github.com/<user>/<name>/blob/{{branch}}/{{filename}}#L{{line}}
(Example:https://github.com/ioBroker/ioBroker.zigbee/blob/{{branch}}/{{filename}}#L{{line}}
) - Translation license: should be equal to the license of the adapter (usually found in LICENSE file of the given adapter)
- Repository browser:
- Click on "Save" to create the component. Creation of new component will take some time.
- Once the creation is completed, click on "Return to the component"
- Go to "Manage" > "Addons"
- Install the following addons one by one:
Flag unchanged translations as "Needs editing"
Flag new source strings as "Needs editing"
Flag new translations as "Needs editing"
Flag new translations as "Cleanup translation files"
- If the adapter provides words.js, also install
ioBroker: Save translations into words.js
- Go back to the component and choose "Manage" > "Settings"
- Go to the tab "Version control"
- Scroll to the bottom and change "Age of changes to commit" to
3
- Click on "Save" to store this change
- Go back to the component and choose "Tools" > "Bulk edit"
- Make a custom search for
NOT language:en
- Set state to
Needs editing
- Press "Apply"
- This will mark all texts as needing action (except for the base language English)
- Make a custom search for