Add Globalize2 so that we get some nice fall backs to other languages when a translation is missing in the requested language.
This commit is contained in:
parent
6ba51da46e
commit
283a3e9ba9
42 changed files with 2670 additions and 0 deletions
2
vendor/plugins/globalize2/test/data/locale/all.yml
vendored
Normal file
2
vendor/plugins/globalize2/test/data/locale/all.yml
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
en-US:
|
||||
from-all-file: From the "all" file.
|
2
vendor/plugins/globalize2/test/data/locale/de-DE.yml
vendored
Normal file
2
vendor/plugins/globalize2/test/data/locale/de-DE.yml
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
de-DE:
|
||||
from-locale-file: Aus der Locale Datei.
|
2
vendor/plugins/globalize2/test/data/locale/en-US.yml
vendored
Normal file
2
vendor/plugins/globalize2/test/data/locale/en-US.yml
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
en-US:
|
||||
from-locale-file: From the locale file.
|
2
vendor/plugins/globalize2/test/data/locale/en-US/module.yml
vendored
Normal file
2
vendor/plugins/globalize2/test/data/locale/en-US/module.yml
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
en-US:
|
||||
from-locale-dir: From the locale directory.
|
2
vendor/plugins/globalize2/test/data/locale/fi-FI/module.yml
vendored
Normal file
2
vendor/plugins/globalize2/test/data/locale/fi-FI/module.yml
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
fi-FI:
|
||||
from-locale-dir: Locale hakemistosta.
|
0
vendor/plugins/globalize2/test/data/locale/root.yml
vendored
Normal file
0
vendor/plugins/globalize2/test/data/locale/root.yml
vendored
Normal file
11
vendor/plugins/globalize2/test/data/no_globalize_schema.rb
vendored
Normal file
11
vendor/plugins/globalize2/test/data/no_globalize_schema.rb
vendored
Normal file
|
@ -0,0 +1,11 @@
|
|||
# This schema creates tables without columns for the translated fields
|
||||
ActiveRecord::Schema.define do
|
||||
create_table :blogs, :force => true do |t|
|
||||
t.string :name
|
||||
end
|
||||
|
||||
create_table :posts, :force => true do |t|
|
||||
t.references :blog
|
||||
end
|
||||
end
|
||||
|
24
vendor/plugins/globalize2/test/data/post.rb
vendored
Normal file
24
vendor/plugins/globalize2/test/data/post.rb
vendored
Normal file
|
@ -0,0 +1,24 @@
|
|||
class Post < ActiveRecord::Base
|
||||
translates :subject, :content
|
||||
validates_presence_of :subject
|
||||
end
|
||||
|
||||
class Blog < ActiveRecord::Base
|
||||
has_many :posts, :order => 'id ASC'
|
||||
end
|
||||
|
||||
class Parent < ActiveRecord::Base
|
||||
translates :content
|
||||
end
|
||||
|
||||
class Child < Parent
|
||||
end
|
||||
|
||||
class Comment < ActiveRecord::Base
|
||||
validates_presence_of :content
|
||||
belongs_to :post
|
||||
end
|
||||
|
||||
class TranslatedComment < Comment
|
||||
translates :content
|
||||
end
|
39
vendor/plugins/globalize2/test/data/schema.rb
vendored
Normal file
39
vendor/plugins/globalize2/test/data/schema.rb
vendored
Normal file
|
@ -0,0 +1,39 @@
|
|||
ActiveRecord::Schema.define do
|
||||
|
||||
create_table :blogs, :force => true do |t|
|
||||
t.string :description
|
||||
end
|
||||
|
||||
create_table :posts, :force => true do |t|
|
||||
t.references :blog
|
||||
end
|
||||
|
||||
create_table :post_translations, :force => true do |t|
|
||||
t.string :locale
|
||||
t.references :post
|
||||
t.string :subject
|
||||
t.text :content
|
||||
end
|
||||
|
||||
create_table :parents, :force => true do |t|
|
||||
end
|
||||
|
||||
create_table :parent_translations, :force => true do |t|
|
||||
t.string :locale
|
||||
t.references :parent
|
||||
t.text :content
|
||||
t.string :type
|
||||
end
|
||||
|
||||
create_table :comments, :force => true do |t|
|
||||
t.references :post
|
||||
end
|
||||
|
||||
create_table :translated_comment_translations, :force => true do |t|
|
||||
t.string :locale
|
||||
t.references :comment
|
||||
t.string :subject
|
||||
t.text :content
|
||||
end
|
||||
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue