public
Description: Transforms gettext to I18n API and generate SimpleBackend locale file
Homepage: http://techblog.floorplanner.com/2008/09/16/converting-a-rails-application-from-gettext-to-i18n/
Clone URL: git://github.com/japetheape/gettext_to_i18n.git
gettext_to_i18n / README
100644 47 lines (26 sloc) 1.229 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
GettextToI18n
=============
 
This plugin will convert your complete Rails project from Gettext calls to the new i18n api calls introduced in Rails 2.2.2. NB: This plugin is higly experimental, so before running, BACKUP YOUR CODE. It will touch your code and things always can go wrong!
 
 
Example
=======
<%=_("Some string that will be translated, into %{lan}" % {:lan => 'english'}) %>
 
will be converted into:
 
<%=t(:message_0, :lan => 'english', :scope => [:controller, :controller_name]) %>
 
it will then place a entry:
 
"Some string that will be translated, into {{lan}}"
 
in the standard.yml locale file it generates.
 
 
About namespaces
========
By default the plugin walks all files in the app directory. It places the message id's into namespaces. The namespace are divided like this:
 
Controllers: translation[:txt][:controller][:controller_name]
Views: translation[:txt][:view][:view_colleciton_name]
-> etc.
 
 
 
Usage
=======
To convert all your views, controllers and models to the new format.
 
rake gettext_to_i18n:transform
 
 
Installation
=======
./script/plugin install git://github.com/japetheape/gettext_to_i18n.git
 
 
 
-------------
Copyright (c) 2008 Jaap van der Meer, released under the MIT license