Project

General

Profile

HowTo translate Redmine in your own language » History » Version 25

Mischa The Evil, 2017-02-10 06:05
Add instructions for translating the bundled help files and added some formatting.

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 25 Mischa The Evil
* The four bundled help files, located in source:trunk/public/help/ under a subdir named after the language subtag
10 1 Jean-Philippe Lang
11 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):
12 1 Jean-Philippe Lang
13
# Copy @/config/locales/en.yml@ to @/config/locales/fi.yml@.
14
# Copy @/public/javascripts/jstoolbar/lang/jstoolbar-en.js@ to @/public/javascripts/jstoolbar/lang/jstoolbar-fi.js@.
15 25 Mischa The Evil
# Copy @/public/help/en/*@ to @/public/help/fi/*@.
16 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@).
17
# Clear the application cache to make the new language available in Redmine (eg. @rake tmp:cache:clear@).
18
19
Then:
20 1 Jean-Philippe Lang
21 25 Mischa The Evil
# Translate every string in _fi.yml_ and _jstoolbar-fi.js_ files and translate the content of the four help files (_wiki_syntax_textile.html_, _wiki_syntax_markdown.html_, _wiki_syntax_detailed_textile.html_ & _wiki_syntax_detailed_markdown.html_).
22 23 David Robinson
# 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.
23 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.
24 1 Jean-Philippe Lang
# Wait until your Issue will be fixed.
25 18 Azamat Hackimov
# Enjoy your work :)
26 1 Jean-Philippe Lang
# GOTO 4 if needed.
27 21 Toshi MARUYAMA
28
h3. Test rake tasks
29
30 24 Toshi MARUYAMA
On Ruby 1.9 or higher:
31 21 Toshi MARUYAMA
<pre>
32
rake locales:check_parsing_by_psych
33
</pre>
34
35 24 Toshi MARUYAMA
On all Ruby versions:
36 21 Toshi MARUYAMA
37
<pre>
38
rake locales:check_interpolation
39
</pre>
40
41
Whole test (Optional)
42
43
<pre>
44
rake test
45
</pre>
46
47 23 David Robinson
"rake test" takes a very long time and it runs automatically on CI server.
48 21 Toshi MARUYAMA
See [[Continuous integration]].
49 16 Azamat Hackimov
50
h2. Restrictions
51 1 Jean-Philippe Lang
52 14 Azamat Hackimov
*All these files must be UTF-8 encoded.* Do not use HTML entities in translated strings.
53
54 23 David Robinson
Check that your files do not have a BOM (Byte-order mark). A BOM can be removed with the following command:
55 14 Azamat Hackimov
56
<pre>
57
awk '{if(NR==1)sub(/^\xef\xbb\xbf/, "");print}' < oldfile > newfile
58 1 Jean-Philippe Lang
</pre>
59 11 Harri H
60 1 Jean-Philippe Lang
As of 2009-02-21, *only updates based on the new translation files* (found in @/config/locales@) *should be submitted.*
61 11 Harri H
62 1 Jean-Philippe Lang
h2. Updates to the language files
63
64 23 David Robinson
The file: "@en.yml@" acts as the main language file. You can check if it has new strings by running:
65 12 Jean-Philippe Lang
<pre>rake locales:update</pre>
66
67 23 David Robinson
This copies any new strings to other translation files (with the English translation as default value).