japetheape / gettext_to_i18n
- Source
- Commits
- Network (3)
- Issues (0)
- Downloads (0)
- Wiki (1)
- Graphs
-
Tree:
7de10a5
gettext_to_i18n / README
| 32bdde30 » | japetheape | 2008-09-08 | 1 | GettextToI18n | |
| 2 | ============= | ||||
| 84ad5388 » | japetheape | 2008-09-08 | 3 | ||
| ad11c2dc » | japetheape | 2008-09-15 | 4 | 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! | |
| 5 | |||||
| 32bdde30 » | japetheape | 2008-09-08 | 6 | ||
| 803a02bd » | japetheape | 2008-09-16 | 7 | Example | |
| 8 | ======= | ||||
| b040c751 » | japetheape | 2008-09-15 | 9 | <%=_("Some string that will be translated, into %{lan}" % {:lan => 'english'}) %> | |
| 09993439 » | japetheape | 2008-09-08 | 10 | ||
| b040c751 » | japetheape | 2008-09-15 | 11 | will be converted into: | |
| 32bdde30 » | japetheape | 2008-09-08 | 12 | ||
| ad11c2dc » | japetheape | 2008-09-15 | 13 | <%=t(:message_0, :lan => 'english', :scope => [:controller, :controller_name]) %> | |
| 32bdde30 » | japetheape | 2008-09-08 | 14 | ||
| b040c751 » | japetheape | 2008-09-15 | 15 | it will then place a entry: | |
| 16 | |||||
| 17 | "Some string that will be translated, into {{lan}}" | ||||
| 18 | |||||
| 19 | in the standard.yml locale file it generates. | ||||
| 20 | |||||
| 21 | |||||
| 803a02bd » | japetheape | 2008-09-16 | 22 | About namespaces | |
| 23 | ======== | ||||
| b040c751 » | japetheape | 2008-09-15 | 24 | 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: | |
| 25 | |||||
| 26 | Controllers: translation[:txt][:controller][:controller_name] | ||||
| 27 | Views: translation[:txt][:view][:view_colleciton_name] | ||||
| ad11c2dc » | japetheape | 2008-09-15 | 28 | -> etc. | |
| 29 | |||||
| b040c751 » | japetheape | 2008-09-15 | 30 | ||
| 31 | |||||
| 803a02bd » | japetheape | 2008-09-16 | 32 | Usage | |
| 33 | ======= | ||||
| 84ad5388 » | japetheape | 2008-09-08 | 34 | To convert all your views, controllers and models to the new format. | |
| 32bdde30 » | japetheape | 2008-09-08 | 35 | ||
| 803a02bd » | japetheape | 2008-09-16 | 36 | rake gettext_to_i18n:transform | |
| 37 | |||||
| 38 | |||||
| 39 | Installation | ||||
| 40 | ======= | ||||
| 41 | ./script/plugin install git://github.com/japetheape/gettext_to_i18n.git | ||||
| 42 | |||||
| 32bdde30 » | japetheape | 2008-09-08 | 43 | ||
| 44 | |||||
| b040c751 » | japetheape | 2008-09-15 | 45 | ------------- | |
| 8171c48d » | japetheape | 2008-09-08 | 46 | Copyright (c) 2008 Jaap van der Meer, released under the MIT license | |
