Skip to content
This repository has been archived by the owner on Feb 28, 2024. It is now read-only.
/ puret Public archive
forked from jo/puret

Puret is a minimal pure translation library for translating database values for Rails 3.

License

Notifications You must be signed in to change notification settings

jobteaser/puret

 
 

Repository files navigation

Customizable Puret: Normal or with a unique locale

We wanted to change for a short period of time one of our model in order to have only one translation without changing the current behaviour. It is now possible to set the locale even if the I18n.locale is different.

Installation

You have to use this specific version

gem 'puret', :git => 'git://github.com/mariekou/puretUniqueLocale.git'

Do not forget to run

bundle install

Basic Usage

The usage is the same as the current one github.com/jo/puret/blob/master/README.rdoc

If you want to have a unique translation

  • you will have to add in your model the :locale method in your puret call

    class Post < ActiveRecord::Base
      puret :title, :description, :locale
    end
    
  • You will then be able to use the locale attribute like if it was a Post attribute

    post.title = 'Puret really rocks!'
    post.locale = 'fr'
    post.save
    

About

Puret is a minimal pure translation library for translating database values for Rails 3.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 100.0%