Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 53 lines (31 sloc) 2.534 kB
bdbf24e First commit
Peter Marklund authored
1 Translate
2 =========
3
4 This plugin provides a web interface for translating Rails I18n texts (requires Rails 2.2 or higher) from one locale to another. The plugin has been tested only with the simple I18n backend that ships with Rails. I18n texts are read from and written to YAML files under config/locales.
5
9287e2f Minor corrections in the README
Peter Marklund authored
6 To translate to a new locale you need to add a YAML file for that locale that contains the locale as the top key and at least one translation.
bdbf24e First commit
Peter Marklund authored
7
9287e2f Minor corrections in the README
Peter Marklund authored
8 Please note that there are certain I18n keys that map to Array objects rather than strings and those are currently not dealt with by the translation UI. This means that Rails built in keys such as date.day_names need to be translated manually directly in the YAML file.
bdbf24e First commit
Peter Marklund authored
9
10 To get the translation UI to write the YAML files in UTF8 you need to install the ya2yaml gem.
11
9287e2f Minor corrections in the README
Peter Marklund authored
12 The translation UI finds all I18n keys by extracting them from I18n lookups in your application source code. In addition it adds all :en and default locale keys from the I18n backend.
bdbf24e First commit
Peter Marklund authored
13
034ff25 Added lost_in_translation and merge_keys rake tasks
Peter Marklund authored
14 Rake Tasks
15 =========
16
17 In addition to the web UI this plugin adds the following two rake tasks:
18
19 translate:lost_in_translation
20 translate:merge_keys
21
22 The lost_in_translation task shows you any I18n keys in your code that are do not have translations in the YAML file for your default locale, i.e. config/locales/sv.yml.
23
24 The merge_keys task is supposed to be used in conjunction with Sven Fuch's Rails I18n TextMate bundle (http://github.com/svenfuchs/rails-i18n/tree/master). Texts and keys extracted with the TextMate bundle end up in the temporary file log/translations.yml. When you run the merge_keys rake task the keys are moved over to the corresponding I18n locale file, i.e. config/locales/sv.yml. The merge_keys task also checks for overwrites of existing keys by warning you that one of your extracted keys already exists with a different translation.
25
bdbf24e First commit
Peter Marklund authored
26 Installation
27 =========
9287e2f Minor corrections in the README
Peter Marklund authored
28 Obtain the source with:
bdbf24e First commit
Peter Marklund authored
29
2e8464e Updating README with new Github URL
Peter Marklund authored
30 ./script/plugin install git://github.com/newsdesk/translate.git
bdbf24e First commit
Peter Marklund authored
31
32 To mount the plugin, add the following to your config/routes.rb file:
33
34 Translate::Routes.translation_ui(map) if RAILS_ENV != "production"
35
36 Now visit /translate in your web browser to start translating.
37
38 Dependencies
39 =========
40
41 - Rails 2.2 or higher
42 - The ya2yaml gem if you want your YAML files written in UTF8 encoding.
43
44 Authors
45 =========
46
47 - Peter Marklund (programming)
48 - Joakim Westerlund (web design)
49
50 Many thanks to http://newsdesk.se for sponsoring the development of this plugin.
51
52 Copyright (c) 2009 Peter Marklund, released under the MIT license
Something went wrong with that request. Please try again.