Plugins - Custom Resource Name

StarAdd to favorites

The Custom Resource Name Plugin lets you add aliases for your routes. This is very useful if you are developing a software to a country that does not speak English and wants all URLs in the native language.

To use it is simpler yet. Open the file routes.rb of your project and include the following lines BEFORE the routes that should be translated:

# translate resources
map.aliases :resources, :posts => ‘artigos‘, :comments => ‘comentarios‘

# translate actions
map.aliases :actions, :new => ‘novo‘, :edit => ‘editar‘, :logout => ‘sair‘

# translate namespaces
map.aliases :namespaces, :admin => ‘administrativo‘

If you have any english route that should stay untouched, put it before the aliases definition.

Carlos Brando

http://www.nomedojogo.com/custom-resource-name-plugin/

http://github.com/carlosbrando/custom_resource_name/tree/master

Rails' (MIT)

  • Currently 5.0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Internationalization

Tags

Comments

Add a comment
Dolný Kubín 24 Jul 2008

Must have plugin if you want to use best practices in development (using english) and need localized urls. dk

Search Plugins

Query syntax

Plugins by Category

Sponsors

Rails Kits: Get Code. Get Moving.

Have a comment?