Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Generator of easy accessor methods for models using Globalize2.

Use globalize_accessors with list of translated fields you want easy access to and extra :locales array listing locales for which you want the accessors to be generated.

This way a single form can be used to edit given model fields with all anticipated translations.

script/plugin install git://github.com/tomash/easy_globalize2_accessors.git

Definition like this:

class Product
  translates :title, :description
  globalize_accessors :pl, :en, :de
end

Gives you access to methods: title_pl, title_en, title_de, title_pl=, title_en=, title_de= (and similar set of description_* methods). And they work seamlessly with Globalize2 (not even touching the “core” title, title= methods used by Globalize2 itself).

  • Make it work with full-blown locales including dash character (minus sign) like en-US, en-GB, pl-PL etc.

Copyright © 2009-2010 Tomek “Tomash” Stachewicz (tomash.wrug.eu), released under the MIT license

About

Easily access (read and write) globalize2-translated fields without fiddling with locale

Resources

Stars

8 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages