Project

General

Profile

HowTo translate Redmine in your own language » History » Revision 23

Revision 22 (Jean-Philippe Lang, 2013-12-15 16:02) → Revision 23/27 (David Robinson, 2014-03-12 13:59)

h1. HowTo translate Redmine to in your own language 

 Redmine can easily be translated to in any language. 

 There are a few things to translate: 

 * The main lang file, located at source:/trunk/config/locales in current trunk 
 * The wiki toolbar lang file, located in source:trunk/public/javascripts/jstoolbar/lang 

 Say you want to translate Redmine to in Finnish (@fi@ as defined in the "IANA Language Subtag Registry":http://www.iana.org/assignments/language-subtag-registry): 

 # Copy @/config/locales/en.yml@ to @/config/locales/fi.yml@. 
 # Copy @/public/javascripts/jstoolbar/lang/jstoolbar-en.js@ to @/public/javascripts/jstoolbar/lang/jstoolbar-fi.js@. 
 # Change the @general_lang_name@ key with the full name of the new language in @fi.yml@ (eg. @general_lang_name: Finnish@). 
 # Clear the application cache to make the new language available in Redmine (eg. @rake tmp:cache:clear@). 

 Then: 

 # Translate every string in fi.yml and jstoolbar-fi.js these files. 
 # Test your translation with the following rake tasks listed [[HowTo_translate_Redmine_in_your_own_language#Test-rake-tasks|below]]. tasks. If you get errors related to locales, you must fix them. 
 # 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. 
 # Wait until your Issue will be fixed. 
 # Enjoy your work :) 
 # GOTO 4 if needed. 

 h3. Test rake tasks 

 On Ruby 1.9. 
 <pre> 
 rake locales:check_parsing_by_psych 
 </pre> 

 On all Ruby versions. version. 

 <pre> 
 rake locales:check_interpolation 
 </pre> 

 Whole test (Optional) 

 <pre> 
 rake test 
 </pre> 

 "rake test" takes a very long time and it runs automatically on CI server. 
 See [[Continuous integration]]. 

 h2. Restrictions 

 *All these files must be UTF-8 encoded.* Do not use HTML entities in translated strings. 

 Check that your files do not have a BOM (Byte-order mark). A BOM can be removed with the following command: 

 <pre> 
 awk '{if(NR==1)sub(/^\xef\xbb\xbf/, "");print}' < oldfile > newfile 
 </pre> 

 As of 2009-02-21, *only updates based on the new translation files* (found in @/config/locales@) *should be submitted.* 

 h2. Updates to the language files 

 The file: "@en.yml@" File @en.yml@ acts as the main language file. You can check if it has new strings by running: 
 <pre>rake locales:update</pre> 

 This copies any the new strings to other translation files (with the English translation as default value).