Project

General

Profile

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

Toshi MARUYAMA, 2012-08-01 14:20
separate "Test rake tasks" section

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 16 Azamat Hackimov
# 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 17 Azamat Hackimov
# 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
# Translate every string in these files.
15 21 Toshi MARUYAMA
# Test your translation with following rake tasks. If you get errors related to locales, you must fix them.
16 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.
17 1 Jean-Philippe Lang
# Wait until your Issue will be fixed.
18 18 Azamat Hackimov
# Enjoy your work :)
19 1 Jean-Philippe Lang
# GOTO 4 if needed.
20 21 Toshi MARUYAMA
21
h3. Test rake tasks
22
23
On Ruby 1.9.
24
<pre>
25
rake locales:check_parsing_by_psych
26
</pre>
27
28
On all Ruby version.
29
30
<pre>
31
rake locales:check_interpolation
32
</pre>
33
34
Whole test (Optional)
35
36
<pre>
37
rake test
38
</pre>
39
40
"rake test" takes very long time and it runs automatically on CI server.
41
See [[Continuous integration]].
42 16 Azamat Hackimov
43
h2. Restrictions
44 1 Jean-Philippe Lang
45 14 Azamat Hackimov
*All these files must be UTF-8 encoded.* Do not use HTML entities in translated strings.
46
47
Check that your files not have BOM (Byte-order mark). BOM can be removed with command:
48
49
<pre>
50
awk '{if(NR==1)sub(/^\xef\xbb\xbf/, "");print}' < oldfile > newfile
51 1 Jean-Philippe Lang
</pre>
52 11 Harri H
53 1 Jean-Philippe Lang
As of 2009-02-21, *only updates based on the new translation files* (found in @/config/locales@) *should be submitted.*
54 11 Harri H
55 1 Jean-Philippe Lang
h2. Updates to the language files
56
57 12 Jean-Philippe Lang
File @en.yml@ acts as the main language file. You can check if it has new strings by running:
58
<pre>rake locales:update</pre>
59
60
This copies the new strings to other translation files (with the English translation as default value).