Skip to content

alippert/globalize3-easy-translate

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

This plugin adds a method to easily access translation attributes.  So if you have a 
translated attribute title in your post model,you can now access the english version 
of the attribute you would call en_title an your post object, here is an example:
post = Post.new(:title => "My title")
post.en_title

this will print out "My title".  To activate the easy access methods, just 
add the following line to your model and pass it the hash of short locale 
names you want to have easy access to:

easy_translate :locales => ["en", "ar"]

or just:

easy_translate 

which will take by default the value of I18n.available_locales if :locales is empty or nil
so you don't need to modify all the model files when you add new locale 


About

Adds some methods to easily access or set translated attributes to your model.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published