This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
| name | age | message | |
|---|---|---|---|
| |
MIT-LICENSE | Sat Nov 29 14:29:18 -0800 2008 | |
| |
README | ||
| |
Rakefile | ||
| |
init.rb | Sun Jan 04 02:47:17 -0800 2009 | |
| |
lib/ | ||
| |
localized_templates.gemspec | ||
| |
test/ |
README
LocalizedTemplates License: MIT Version: 0.3.1 Description ================== This plugin uses Rails I18n (http://rails-i18n.org/) to allow templates localization. You can localize your views using the following naming convention: <tt>pt-BR/projects/index.html.erb</tt> <tt>en-US/projects/edit.rss.builder</tt> And you can also localize rescue files: <tt>public/pt-BR/404.html</tt> <tt>public/en-US/404.html</tt> If you don't want to localize a file (like a xml file), simply don't move it and it will be rendered as default to all languages. Installation ================= Install LocalizedTemplates is very easy. It is stored in GitHub, so if you have never installed a gem via GitHub run the following: gem sources -a http://gems.github.com Then install the gem: sudo gem install josevalim-localized_templates In RAILS_ROOT/config/environment.rb: config.gem "josevalim-localized_templates", :lib => "localized_templates", :source => "http://gems.github.com" If you want it as plugin, just do: cd myapp git clone git://github.com/josevalim/localized_templates.git rm -rf vendor/plugins/localized_templates/.git Adding a new locale ================= To add a new locale, simply create a new file in config/locales. You can make your life easier by copying an existing locale and basing your new locale on it. Check installed locales ================= To display a list of all locales installed in config/locales, you can use the following rake command: rake locales Changing the default locale ================= If you want to use a default locale other than en-US, you have to tell the i18n plugin the locale you want to use by default. Simply put the following line in an initializer in config/initializers or include it in your environment.rb: I18n.default_locale = 'de-AT' Bugs and Feedback ================= If you discover any bugs, please send an e-mail to jose.valim@gmail.com If you just want to give some positive feedback or drop a line, that's fine too! =) Copyright (c) 2009 José Valim http://www.pagestacker.com/ http://josevalim.blogspot.com/









