HowTo translate Redmine in your own language » History » Version 23
David Robinson, 2014-03-12 13:59
Light proofreading
| 1 | 23 | David Robinson | h1. HowTo translate Redmine to your own language |
|---|---|---|---|
| 2 | 1 | Jean-Philippe Lang | |
| 3 | 23 | David Robinson | Redmine can easily be translated to any language. |
| 4 | 1 | Jean-Philippe Lang | |
| 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 | 23 | David Robinson | Say you want to translate Redmine to Finnish (@fi@ as defined in the "IANA Language Subtag Registry":http://www.iana.org/assignments/language-subtag-registry): |
| 11 | 1 | Jean-Philippe Lang | |
| 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 | 23 | David Robinson | # Translate every string in fi.yml and jstoolbar-fi.js files. |
| 20 | # Test your translation with the rake tasks listed [[HowTo_translate_Redmine_in_your_own_language#Test-rake-tasks|below]]. 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 | 23 | David Robinson | On all Ruby versions. |
| 34 | 21 | Toshi MARUYAMA | |
| 35 | <pre> |
||
| 36 | rake locales:check_interpolation |
||
| 37 | </pre> |
||
| 38 | |||
| 39 | Whole test (Optional) |
||
| 40 | |||
| 41 | <pre> |
||
| 42 | rake test |
||
| 43 | </pre> |
||
| 44 | |||
| 45 | 23 | David Robinson | "rake test" takes a very long time and it runs automatically on CI server. |
| 46 | 21 | Toshi MARUYAMA | 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 | 23 | David Robinson | Check that your files do not have a BOM (Byte-order mark). A BOM can be removed with the following command: |
| 53 | 14 | Azamat Hackimov | |
| 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 | 23 | David Robinson | The file: "@en.yml@" acts as the main language file. You can check if it has new strings by running: |
| 63 | 12 | Jean-Philippe Lang | <pre>rake locales:update</pre> |
| 64 | |||
| 65 | 23 | David Robinson | This copies any new strings to other translation files (with the English translation as default value). |