Project

General

Profile

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

Johannes Gangsö, 2025-03-04 14:47
Added exact locations of the wiki_syntax help files, add mention about datepicker file too.

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