josevalim / localized_templates
- Source
- Commits
- Network (2)
- Issues (0)
- Downloads (1)
- Wiki (1)
- Graphs
-
Tree:
4280833
localized_templates / README
| 2a52a6f7 » | josevalim | 2009-01-30 | 1 | LocalizedTemplates | |
| 7f2bbc1c » | josevalim | 2008-10-25 | 2 | License: MIT | |
| e16fb5f8 » | josevalim | 2009-02-05 | 3 | Version: 0.4 | |
| 7f2bbc1c » | josevalim | 2008-10-25 | 4 | ||
| 2a52a6f7 » | josevalim | 2009-01-30 | 5 | Description | |
| 7f2bbc1c » | josevalim | 2008-10-25 | 6 | ================== | |
| 7 | |||||
| 8 | This plugin uses Rails I18n (http://rails-i18n.org/) to allow templates localization. | ||||
| 9 | You can localize your views using the following naming convention: | ||||
| 10 | |||||
| 11 | <tt>pt-BR/projects/index.html.erb</tt> | ||||
| 12 | <tt>en-US/projects/edit.rss.builder</tt> | ||||
| 13 | |||||
| 14 | And you can also localize rescue files: | ||||
| 15 | |||||
| 16 | <tt>public/pt-BR/404.html</tt> | ||||
| 17 | <tt>public/en-US/404.html</tt> | ||||
| d7a817bf » | josevalim | 2008-09-10 | 18 | ||
| 336aca10 » | josevalim | 2008-12-18 | 19 | If you don't want to localize a file (like a xml file), simply don't move it and it will be | |
| d7a817bf » | josevalim | 2008-09-10 | 20 | rendered as default to all languages. | |
| 21 | |||||
| e16fb5f8 » | josevalim | 2009-02-05 | 22 | This is an alternative to Rails 2.3 templates localization schema. If you are | |
| 23 | localizing almost all of your views, it definitely suits you better because | ||||
| 24 | your views will be better organized. | ||||
| 25 | |||||
| d7a817bf » | josevalim | 2008-09-10 | 26 | Installation | |
| 27 | ================= | ||||
| 28 | |||||
| e16fb5f8 » | josevalim | 2009-02-05 | 29 | Install LocalizedTemplates is very easy. If you are running run on Rails 2.3 | |
| 30 | just do the following: | ||||
| d7a817bf » | josevalim | 2008-09-10 | 31 | ||
| 612dda54 » | josevalim | 2008-11-29 | 32 | gem sources -a http://gems.github.com | |
| 33 | sudo gem install josevalim-localized_templates | ||||
| 34 | |||||
| 35 | In RAILS_ROOT/config/environment.rb: | ||||
| 36 | |||||
| 37 | config.gem "josevalim-localized_templates", :lib => "localized_templates", :source => "http://gems.github.com" | ||||
| 38 | |||||
| 39 | If you want it as plugin, just do: | ||||
| 40 | |||||
| e16fb5f8 » | josevalim | 2009-02-05 | 41 | script/plugin install git://github.com/josevalim/localized_templates.git | |
| d7a817bf » | josevalim | 2008-09-10 | 42 | ||
| e16fb5f8 » | josevalim | 2009-02-05 | 43 | If you are running on Rails 2.2, you should use version 0.3.1: | |
| d7a817bf » | josevalim | 2008-09-10 | 44 | ||
| e16fb5f8 » | josevalim | 2009-02-05 | 45 | cd myapp | |
| 46 | git clone git://github.com/josevalim/localized_tempaltes.git | ||||
| 47 | cd vendor/plugins/localized_templates | ||||
| 48 | git checkout v0.3.1 | ||||
| 49 | rm -rf ./.git | ||||
| d7a817bf » | josevalim | 2008-09-10 | 50 | ||
| 51 | |||||
| 52 | Bugs and Feedback | ||||
| 53 | ================= | ||||
| 54 | |||||
| 2a52a6f7 » | josevalim | 2009-01-30 | 55 | If you discover any bugs, please send an e-mail to jose.valim@gmail.com | |
| 56 | If you just want to give some positive feedback or drop a line, that's fine too! =) | ||||
| 57 | |||||
| 58 | Copyright (c) 2009 José Valim | ||||
| 59 | http://www.pagestacker.com/ | ||||
| 60 | http://josevalim.blogspot.com/ | ||||

