Project

General

Profile

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

Go MAEDA, 2021-04-13 09:35
rake check_parsing_by_psych has been removed by #35026

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 26 Go MAEDA
Test if translation files can be parsed without errors and there are no missing keys
31 21 Toshi MARUYAMA
32
<pre>
33
rake locales:check_interpolation
34
</pre>
35
36
Whole test (Optional)
37
38
<pre>
39
rake test
40
</pre>
41
42 23 David Robinson
"rake test" takes a very long time and it runs automatically on CI server.
43 21 Toshi MARUYAMA
See [[Continuous integration]].
44 16 Azamat Hackimov
45
h2. Restrictions
46 1 Jean-Philippe Lang
47 14 Azamat Hackimov
*All these files must be UTF-8 encoded.* Do not use HTML entities in translated strings.
48
49 23 David Robinson
Check that your files do not have a BOM (Byte-order mark). A BOM can be removed with the following command:
50 14 Azamat Hackimov
51
<pre>
52
awk '{if(NR==1)sub(/^\xef\xbb\xbf/, "");print}' < oldfile > newfile
53 1 Jean-Philippe Lang
</pre>
54 11 Harri H
55 1 Jean-Philippe Lang
As of 2009-02-21, *only updates based on the new translation files* (found in @/config/locales@) *should be submitted.*
56 11 Harri H
57 1 Jean-Philippe Lang
h2. Updates to the language files
58
59 23 David Robinson
The file: "@en.yml@" acts as the main language file. You can check if it has new strings by running:
60 12 Jean-Philippe Lang
<pre>rake locales:update</pre>
61
62 23 David Robinson
This copies any new strings to other translation files (with the English translation as default value).