Skip to content

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

License

Notifications You must be signed in to change notification settings

tomash/easy_globalize2_accessors

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EasyGlobalizeAccessors

Introduction

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.

Installation

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

Example

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).

TODO

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

blah blah

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

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages