en
Language
  • en
  • de
  • fr
  • es
  • br
  • ru
  • jp
  • kr
AI translation
  • ae
  • cn
  • vn
  • id
  • eu
  • il
  • gr
  • no
  • fi
  • dk
  • se
  • tr
  • bg
  • nl
  • it
  • pl
  • hu
  • ro
  • ua
  • cs

How to Translate Redmine to Any Language

5/26/2020
5 minutes
Lukáš Beňa

One of Redmine’s greatest features is that you can easily translate this project management application to any language you want.

Disclaimer: The information in this article applies only to Redmine and does not apply to Easy Redmine.

When it comes to Redmine translation, you have to translate a couple of things:

  • The primary lang file: this file is situated in the current trunk at source: /trunk/config /locales.
  • The wiki toolbar lang file: this file is situated in the source: trunk/public/javascripts/jstoolbar/lang
  • The 4 bundled help files: All of these files are situated in the source: trunk/public/help/ under a subdirectory that is named after the language subtag

As a case to point, say you would like to translate the Redmine application to the Finnish language (the Language Subtag Registry defines the language as “fi”). In order to do so, you should observe the following steps:


Steps

  • Step 1: Copy paste /config/locales/en.yml to /config/locales/fi.yml
  • Step 2: Copy paste  /public/javascripts/jstoolbar/lang/jstoolbar-en.js to /public/javascripts/jstoolbar/lang/jstoolbar-fi.js
  • Step 3: Copy paste /public/help/en/* to /public/help/fi/*.
  • Step 4: Modify the general_lang_name key with the new language’s full name in fi.yml (in this instance:  general_lang_name: Finnish)
  • Step 5: Next, clear the application cache. This will make the new language (Finnish) available in the Redmine software (example, rake tmp: cache: clear)

After following the aforementioned steps, proceed with the following:

  • Step 6: Translate each string in jstoolbar-fi.js and fi.yml  files and translate content of the 4 help files (wiki_syntax_markdown.html ,wiki_syntax_textile.html,  wiki_syntax_detailed_markdown.html and wiki_syntax_detailed_textile.html)
  • Step 7: Use the rake tasks (these have been detailed below) to test your translation. You must fix any errors (if you get any) related to locales.
  • Step 8: Submit your translation in the form of patch or plain file( login will be required). From the category listbox, select “Translation”.
  • Step 9: Finally and most importantly, enjoy your translation work!


The Test rake tasks:

  • If you are using the Ruby 1.9 version or higher:

rake locales: check_parsing_by_psych

  • On all of the Ruby versions:

rake locales: check_interpolation

  • Whole test (this is optional) : rake test

Bear in mind that "rake test" consumes quite a long period of time and it automatically runs on CI (Continuous Integration) server.


Restrictions in place

Make note that there are certain restrictions in place

  • All of the files have to be 8-bit Unicode Transformation Format (UTF-8) encoded. In translated strings, do not make use of HTML (Hypertext Markup Language) entities.
  • Make sure that you check your files do not feature a Byte-order mark (BOM). You can remove a Byte-order mark with this command: awk '{if(NR==1)sub(/^\xef\xbb\xbf/, "");print}' < oldfile > newfile
  • You should only submit updates based on new files of translation ( you can find these updates in/config/locales)


Updates to Language Files

"en.yml" file acts in the capacity of the primary language file.  By running rake locales: update, you can check whether it features new strings. This command copies any of the new strings to other files of translation ( the default value is the English translation).

In translation in Redmine, you can also enable 3rd party plugins to support translations that comprise customizable terms.


Customizing terminologies over Translations in Redmine

  • Set the existing directory to config/overrides/<locale> within the plugin
  • Copy-paste the current 000.yml to ./XXX.yml. Here “XXX” is a three-digit number that defines your definitions’ priority: Higher the number, higher the priority. It is best to avoid the creation of 999.yml. This will allow you to leave more space for additional overrides.
  • Filter out those specific definitions that you do not wish to modify. In this manner, a file with lower priority will be able to apply its modifications to the elements that you do not wish to meddle with.
  • Over the remaining terms, apply your own definitions


Supporting Terms that are Customizable in your Plugin

  • As usual, provide translation files under config/locales, for functioning properly when you have not installed the plugin. If you do not, you should explicitly require this plugin in your init.rb. If you seek further information, check out the Redmine documentation
  • Copy paste your locales under config/locales
  • For every listed term that is overridable in 000.yml, change the translations in order to apply an interpolation. For instance, when you print issue, you ought to swap the word with %{issue}. Furthermore, when you print issue(s), you ought to swap the word with %{issue_or_issues}.
  • You can support a greater number of overridable terms in your plugin. However, if you are also using it in base Redmine, you have add interpolated definitions for Redmine terminologies.

As a case to point, you can support a new %{my_term} terminology in your elocales. If the translation is used in Redmine terms as well, you will include them to your elocales with correct replacement of %{my_term} to ensure consistency in translation.

Try Easy Redmine in 30 days free trial

Full features, SSL protected, daily backups, in your geolocation