Sha256: b5d3a2bbe8716f99514ce3107613cd8b678a4bee3b385433c54d5ecffb7e066c
Contents?: true
Size: 543 Bytes
Versions: 7
Compression:
Stored size: 543 Bytes
Contents
$LOAD_PATH.unshift "../lib" require 'rubygems' require 'gettext' require 'gettext_activerecord' require 'yaml' require 'book' config = YAML.load(IO.read("config/database.yml"))["development"] ActiveRecord::Base.establish_connection(config) GetText.bindtextdomain_to(ActiveRecord, "sample_ar", :path => "locale") GetText.set_locale "ja_JP.UTF-8" book = Book.new book.title = "Foo" book.save puts book.errors.full_messages #puts Japanese error message. GetText.set_locale "en" puts book.errors.full_messages #puts English error message.
Version data entries
7 entries across 7 versions & 2 rubygems