Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

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

branch: master

This branch is 0 commits ahead and 0 commits behind master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 test
Octocat-spinner-32 MIT-LICENSE
Octocat-spinner-32 README.rdoc
Octocat-spinner-32 Rakefile
Octocat-spinner-32 init.rb
README.rdoc

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/astropanic/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 Tomek “Tomash” Stachewicz (tomash.wrug.eu), released under the MIT license

Something went wrong with that request. Please try again.