summaryrefslogtreecommitdiff
path: root/vendor/plugins/globalize2/README.textile
diff options
context:
space:
mode:
authorerdgeist <erdgeist@erdgeist.org>2026-06-24 04:13:16 +0200
committererdgeist <erdgeist@erdgeist.org>2026-06-24 04:13:16 +0200
commite0a7e0fec760ba12c8067a37e10c96f1f05876e2 (patch)
treed0cf745592a46aee4d4913911fd34c7c24515220 /vendor/plugins/globalize2/README.textile
parent6424e10be5a89f175a74c71c55660412a169b8b8 (diff)
Stage 1 complete: Rails 2.3.5 to Rails 3.2.22.5 upgrade
- Converted plugins to gems (Gemfile) - Updated config structure (application.rb, boot.rb, environment.rb) - Converted routes to Rails 3 DSL - Converted named_scope to scope throughout models - Converted find(:all, :conditions) to where() chains - Fixed has_many :order to use ordering scope - Updated session store and secret token configuration - Fixed exception_notification middleware configuration - Patched Ruby 2.4 / Rails 3.2 incompatibilities: - Integer/Float duration arithmetic (ActiveSupport) - Arel visit_Integer for PostgreSQL adapter - create_database String/Integer coercion - ActionController consider_all_requests_local - Migrated taggings schema for acts-as-taggable-on - Replaced dynamic_form gem with custom form_error_messages helper - Fixed Rails 3 block helper syntax (form_for, form_tag, fields_for) - Fixed admin layout yield - Updated test suite for Rails 3 APIs
Diffstat (limited to 'vendor/plugins/globalize2/README.textile')
-rw-r--r--vendor/plugins/globalize2/README.textile65
1 files changed, 0 insertions, 65 deletions
diff --git a/vendor/plugins/globalize2/README.textile b/vendor/plugins/globalize2/README.textile
deleted file mode 100644
index 7155a7c..0000000
--- a/vendor/plugins/globalize2/README.textile
+++ /dev/null
@@ -1,65 +0,0 @@
1h1. Globalize2
2
3Globalize2 is the successor of Globalize for Rails.
4
5It is compatible with and builds on the new "I18n api in Ruby on Rails":http://guides.rubyonrails.org/i18n.html. and adds model translations to ActiveRecord.
6
7Globalize2 is much more lightweight and compatible than its predecessor was. Model translations in Globalize2 use default ActiveRecord features and do not limit any ActiveRecord functionality any more.
8
9h2. Requirements
10
11ActiveRecord
12I18n
13
14(or Rails > 2.2)
15
16h2. Installation
17
18To install Globalize2 with its default setup just use:
19
20<pre><code>
21script/plugin install git://github.com/joshmh/globalize2.git
22</code></pre>
23
24h2. Model translations
25
26Model translations allow you to translate your models' attribute values. E.g.
27
28<pre><code>
29class Post < ActiveRecord::Base
30 translates :title, :text
31end
32</code></pre>
33
34Allows you to values for the attributes :title and :text per locale:
35
36<pre><code>
37I18n.locale = :en
38post.title # => Globalize2 rocks!
39
40I18n.locale = :he
41post.title # => גלובאלייז2 שולט!
42</code></pre>
43
44In order to make this work, you'll need to add the appropriate translation tables. Globalize2 comes with a handy helper method to help you do this. It's called @create_translation_table!@. Here's an example:
45
46<pre><code>
47class CreatePosts < ActiveRecord::Migration
48 def self.up
49 create_table :posts do |t|
50 t.timestamps
51 end
52 Post.create_translation_table! :title => :string, :text => :text
53 end
54 def self.down
55 drop_table :posts
56 Post.drop_translation_table!
57 end
58end
59</code></pre>
60
61Note that the ActiveRecord model @Post@ must already exist and have a @translates@ directive listing the translated fields.
62
63h2. Migration from Globalize
64
65See this script by Tomasz Stachewicz: http://gist.github.com/120867