Developers must do the following to localize a plugin or other module:
Prepare a Java source file for localization shows the detailed internationalization steps. The advanced localization documentation provides guidance for more sophisticated internationalization, like date formatting, time formatting, and number formatting.
The Jenkins project always welcomes contributions to translations. If you are interested in helping us, just file a pull request on GitHub. In the remainder of this section, we discuss what needs to be translated and how.
Remember that properties files must be encoded in ISO 8859-1. This should be the default anyway. |
Translation Tool : Command line tool to help translators to generate files, add missing keys, and more.
Translation Assistance Plugin : Adds a dialog box in Jenkins to translate and send missing keys.
Messages.properties
Developers place messages that require localization in Messages.properties
.
Those need to be translated in the usual manner.
See Messages_ja.properties
in the core as an example if you are new to this process.
If looking at Messages.properties
alone does not give you enough contextual information about where the messages are used.
You can access messages with the type-safe Messages
class generated by
Localizer.
To find out where messages are actually used, use your IDE to find all the usages of the message format method.
Stand-alone HTML files are often used in Jenkins for things like inline help messages.
To translate these resources, add the locale code between the file name and the extension.
For example, the Japanese version of abc.html
would be abc_ja.html
, and the British version of it could be abc_en_GB.html
.
These files must be encoded in UTF-8.
After successfully testing the changes interactively, submit a pull request to propose the changes. Instructions for localization pull requests to Jenkins core are available in the Jenkins core contributing guide. Plugins that use Crowdin for translation can follow the Crowdin translation instructions. Plugins that do not use Crowdin for translation should submit a pull request according to the contributing guide for the specific plugin.
When starting a translation, try to check if anyone else is working on the same locale. You can find out who they are by finding existing localization and looking at its history. Try to get in touch with them to avoid a surprise.
Refactoring the existing code to handle i18n correctly is tedious. So IntelliJ IDEA plugin Jenkins Development Support is developed to simplify this.