Translations

From Official Kodi Wiki
Jump to navigation Jump to search
Home icon grey.png   ▶ Development
▶ Add-on development
▶ Translations

1 History

In the development cycle from Eden (V11) to Frodo (V12) the translation system has been revised.

The former strings.xml file has been superseeded by the appropriate strings.po files. Due to that the way how translations are handled has been changed, too.

2 Weblate

The whole translation system has been moved to Weblate.

So if you want to help translating Kodi into your native language, first thing you need to do is to sign up at Weblate.
Please visit this forum post to let us know which language you would like to translate.
Once added to a langage team, you can start translating immediately.

2.1 Profile

In the top right, you can find your profile settings:

Weblate profile settings

In the Language tab you can select the interface language, the language you can translate to and your secondary languages:

Weblate language settings

In the Notifications tab you can select your watched projects.
Those projects can be selected in the top Projects menu.
We recommend selecting all projects to have easy access to all components.

Weblate watched projects settings


Now you are ready to translate components:

Weblate main screen

2.2 Translating Kodi and other components

Note: Please do not download files, modify them and upload again! Always translate components and strings inside Weblate!

Ok, let's get to work!

Search that part of the project that needs updating.
You can see the percentage of the translations, untranslated strings / words / characters:

Components at Weblate

You might note that there is some untranslated strings in "Kodi core/kodi main".
So we click either on the pencil to the left or on the language label to translate it:

Translate buttons highlighted

The next screen will show you all information on the chosen language.

We recommend to take care of most alerts: BBcode markup, mismatched \n, mismatching line breaks, XML markup, starting spaces, trailing spaces, double space, unchanged translations.
Keeping alerts might break the file and ultimately lead to Kodi crashing.
Alerts can be cleared when selecting the string with the alert.

Translate window inside Weblate

If you want to translate the component, "Not translated strings" is where to go.

Clicking any item in the previous image will take you here:

Weblate translate.png

  • SOURCE STRING COMMENT: The developers can create useful comments for the string, e.g. what it exactly does or where it can be found in the GUI.
  • GLOSSARY: View the glossary entries matching your current string. You can also add new glossary entries.
  • NBS: "No-break space" is a character used if you can't translate the source string into your native language. It's useful for languages that don't have certain words. It will not take up any character space and will not use the source string.
  • REVIEW STATE: Reviewers/coordinators can approve strings or mark them for editing.
  • AUTOMATIC SUGGESTIONS: Matching strings and translations from other components will be listed here. This is great for keeping consistency. We recommend keeping this tab open when translating.


Colors explaining Weblate translate window

Other languages tab is great for looking at the current string translated into other languages. Works well for closely related languages.

Other languages tab at Weblate

Comments tab: Here you can make comments on the current string for other translators, reviewers and developers to read.
You can also make source string comments or suggestions for changes to the string.

Comments for strings

3 Useful hints

This part shows some additional information for developers and translators to make things more easy. So it's worth taking a look.


3.1 Details & Comments

The developers can set special marks in the strings.po file to give a useful comment on that string. e.g. what it exactly does or where it can be found in the GUI.

Comments in a string


In the source file it looks like this:

#. play GUI sounds
#: xbmc/settings/GUISettings.cpp
msgctxt "#34122"
msgid "Always"
msgstr ""


With #. we can add a helper comment or context to help translators understand the meaning or usage of string.

with #: we can specify where the string is used. Sometimes this could also be a useful info.

4 Submit your add-on or skin for translation

We encourage all developers with addons in the official Kodi add-on repo to submit their addon for translation at Weblate.

Handling of translations for your add-on will become much more simple, as most things are automated.
Weblate will get updated instantly whenever you add or remove a translation from your source en_gb file.
Translations can be synced to your upstream repository whenever you wish (default is 5 days) either by pull request or direct push.
All languages at Weblate will be kept in sync with the en_gb source file.

Summary, description and disclaimer can be automatically synced between addon.xml and language files either by pull request or direct push whenever changes are made.

We require the following info:

  • URL to your repo at Github/Gitlab
  • Branch
  • Would you like pull requests or direct pushes from Weblate? (Pull requests are safest, direct pushes are easiest.)
  • How often would you like pull requests/direct pushes? Default is 5 days, but it's totally up to you.
  • Do you want a version bump in addon.xml?


For your main source en_gb file to get synced with Weblate, you must add this webhook to your repository for the push event:

https://kodi.weblate.cloud/hooks/github

webhook for Weblate

If direct pushes are wanted, you need to add Github user "weblate" as collaborator.
This user will automatically accept any collaboration within 5 minutes.
If pull requests are the preferred method, Weblate will push to the same pull request until merged or closed.

Please visit this forum post for more information.

5 Contact and support

If you have problems with Weblate your first person to contact should be the coordinator of your language!

If you have more general questions you might head over to the forums and post your question in the translations section.
Gade and others can help you there.

6 Sync time schedule

Changes to the main source en_gb file are synced instantly from Github to Weblate.
Translations are pushed from Weblate to Github every 5 days (default, but can be configured) if any translations are made.

For Kodi language add-ons, new versions are released every time a Weblate pull request is merged.

7 Syntax verification

For keeping the strings correctly formatted, we do a constant syntax verification at all times.
Changes are either done at Weblate or by pull request to the upstream repository.


Return to top