HowTo translate Redmine in your own language » History » Version 22
Jean-Philippe Lang, 2013-12-15 16:02
cache needs to be clear after adding a new locale
| 1 | 1 | Jean-Philippe Lang | h1. HowTo translate Redmine in your own language |
|---|---|---|---|
| 2 | |||
| 3 | Redmine can easily be translated in any language. |
||
| 4 | |||
| 5 | 4 | Jean-Philippe Lang | There are a few things to translate: |
| 6 | 1 | Jean-Philippe Lang | |
| 7 | 22 | Jean-Philippe Lang | * The main lang file, located at source:/trunk/config/locales in current trunk |
| 8 | * The wiki toolbar lang file, located in source:trunk/public/javascripts/jstoolbar/lang |
||
| 9 | 1 | Jean-Philippe Lang | |
| 10 | Say you want to translate Redmine in Finnish (@fi@ as defined in the "IANA Language Subtag Registry":http://www.iana.org/assignments/language-subtag-registry): |
||
| 11 | |||
| 12 | # Copy @/config/locales/en.yml@ to @/config/locales/fi.yml@. |
||
| 13 | # Copy @/public/javascripts/jstoolbar/lang/jstoolbar-en.js@ to @/public/javascripts/jstoolbar/lang/jstoolbar-fi.js@. |
||
| 14 | 22 | Jean-Philippe Lang | # Change the @general_lang_name@ key with the full name of the new language in @fi.yml@ (eg. @general_lang_name: Finnish@). |
| 15 | # Clear the application cache to make the new language available in Redmine (eg. @rake tmp:cache:clear@). |
||
| 16 | |||
| 17 | Then: |
||
| 18 | |||
| 19 | 17 | Azamat Hackimov | # Translate every string in these files. |
| 20 | 21 | Toshi MARUYAMA | # Test your translation with following rake tasks. If you get errors related to locales, you must fix them. |
| 21 | 18 | Azamat Hackimov | # Submit your translation "here":http://www.redmine.org/projects/redmine/issues/new?tracker_id=3 (as plain file or patch, login required). Select "Translation" in Category listbox. |
| 22 | 1 | Jean-Philippe Lang | # Wait until your Issue will be fixed. |
| 23 | 18 | Azamat Hackimov | # Enjoy your work :) |
| 24 | 1 | Jean-Philippe Lang | # GOTO 4 if needed. |
| 25 | 21 | Toshi MARUYAMA | |
| 26 | h3. Test rake tasks |
||
| 27 | |||
| 28 | On Ruby 1.9. |
||
| 29 | <pre> |
||
| 30 | rake locales:check_parsing_by_psych |
||
| 31 | </pre> |
||
| 32 | |||
| 33 | On all Ruby version. |
||
| 34 | |||
| 35 | <pre> |
||
| 36 | rake locales:check_interpolation |
||
| 37 | </pre> |
||
| 38 | |||
| 39 | Whole test (Optional) |
||
| 40 | |||
| 41 | <pre> |
||
| 42 | rake test |
||
| 43 | </pre> |
||
| 44 | |||
| 45 | "rake test" takes very long time and it runs automatically on CI server. |
||
| 46 | See [[Continuous integration]]. |
||
| 47 | 16 | Azamat Hackimov | |
| 48 | h2. Restrictions |
||
| 49 | 1 | Jean-Philippe Lang | |
| 50 | 14 | Azamat Hackimov | *All these files must be UTF-8 encoded.* Do not use HTML entities in translated strings. |
| 51 | |||
| 52 | Check that your files not have BOM (Byte-order mark). BOM can be removed with command: |
||
| 53 | |||
| 54 | <pre> |
||
| 55 | awk '{if(NR==1)sub(/^\xef\xbb\xbf/, "");print}' < oldfile > newfile |
||
| 56 | 1 | Jean-Philippe Lang | </pre> |
| 57 | 11 | Harri H | |
| 58 | 1 | Jean-Philippe Lang | As of 2009-02-21, *only updates based on the new translation files* (found in @/config/locales@) *should be submitted.* |
| 59 | 11 | Harri H | |
| 60 | 1 | Jean-Philippe Lang | h2. Updates to the language files |
| 61 | |||
| 62 | 12 | Jean-Philippe Lang | File @en.yml@ acts as the main language file. You can check if it has new strings by running: |
| 63 | <pre>rake locales:update</pre> |
||
| 64 | |||
| 65 | This copies the new strings to other translation files (with the English translation as default value). |