tenon 1.0.29 → 1.0.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.rdoc +23 -5
- data/lib/generators/tenon/i18n_migrations/templates/migration.rb +5 -1
- data/lib/tenon/version.rb +1 -1
- metadata +1 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aca3f38752e365cacea4884b7f6b110219d0e419
|
4
|
+
data.tar.gz: 1dcf4c6875aaad31017bc915ea2424efb37d0723
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 24e930b9842ade7b39be4920eeaee4ea4b9fb7c5c5b71c8fa3af9a640a7b2e96ad7460f8aaad1962e27ec86acb7b250cb4bfa6f52d8bb93368b743f5c67b1224
|
7
|
+
data.tar.gz: dee64e261c020471aa37c0acafe692fde4846869daecac6e0e5230891a55df20f0741dcd7fd724e3b499fb872e84f030a0848d89b10da37661b01a5fa21db375
|
data/README.rdoc
CHANGED
@@ -74,12 +74,12 @@ TODO: Write this section
|
|
74
74
|
|
75
75
|
== Internationalization
|
76
76
|
|
77
|
-
Although Tenon is currently anglocentric it supports the
|
77
|
+
Although Tenon is currently anglocentric it supports the inclusion of additional
|
78
78
|
languages and provides an interface for managing content in multiple languages.
|
79
79
|
|
80
80
|
To add internationalized fields, follow these steps:
|
81
81
|
|
82
|
-
1. Tell Tenon which languages you want to support in config/initializers/tenon.rb
|
82
|
+
1. Tell Tenon which languages you want to support in config/initializers/tenon.rb (You don't need to add English, Tenon always assumes its in use.)
|
83
83
|
|
84
84
|
config.languages = {
|
85
85
|
"French" => :fr,
|
@@ -87,8 +87,6 @@ To add internationalized fields, follow these steps:
|
|
87
87
|
# etc.
|
88
88
|
}
|
89
89
|
|
90
|
-
English is always assumed to exist and be the default language, but this will likely change in the future.
|
91
|
-
|
92
90
|
2. Create or update config/i18n_fields.yml to tell Tenon which fields you would like to have internationalized.
|
93
91
|
|
94
92
|
tables:
|
@@ -112,4 +110,24 @@ English is always assumed to exist and be the default language, but this will li
|
|
112
110
|
tenon_content :description, i18n: true
|
113
111
|
end
|
114
112
|
|
115
|
-
Once you've done this and restarted your app you will see a language selection nav in the sidebar of each form that has internationalized fields.
|
113
|
+
Once you've done this and restarted your app you will see a language selection nav in the sidebar of each form that has internationalized fields.
|
114
|
+
|
115
|
+
If you want to add internationalization to the default Tenon models you should make your i18n_fields.yml look like this:
|
116
|
+
|
117
|
+
tables:
|
118
|
+
tenon/events:
|
119
|
+
- title
|
120
|
+
- location
|
121
|
+
|
122
|
+
tenon/pages:
|
123
|
+
- title
|
124
|
+
- seo_title
|
125
|
+
- seo_keywords
|
126
|
+
- seo_description
|
127
|
+
|
128
|
+
tenon/posts:
|
129
|
+
- title
|
130
|
+
- excerpt
|
131
|
+
- seo_title
|
132
|
+
- seo_keywords
|
133
|
+
- seo_description
|
@@ -5,7 +5,11 @@ class AddI18nFields<%= file_hash.capitalize %> < ActiveRecord::Migration
|
|
5
5
|
<% languages.each do |language| -%>
|
6
6
|
<% klass = table.singularize.camelize.constantize -%>
|
7
7
|
<% unless klass.column_names.include?("#{column}_#{language}") -%>
|
8
|
-
|
8
|
+
<% if klass.columns_hash[column.to_s] -%>
|
9
|
+
add_column :<%= table.gsub('/', '_') %>, :<%= column %>_<%= language %>, :<%= klass.columns_hash[column.to_s].type %>
|
10
|
+
<% else -%>
|
11
|
+
<% puts "Table #{table} has no column #{column}" -%>
|
12
|
+
<% end -%>
|
9
13
|
<% end -%>
|
10
14
|
<% end -%>
|
11
15
|
<% end -%>
|
data/lib/tenon/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tenon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.30
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- factor[e] design initiative
|
@@ -150,20 +150,6 @@ dependencies:
|
|
150
150
|
- - '='
|
151
151
|
- !ruby/object:Gem::Version
|
152
152
|
version: 0.22.0
|
153
|
-
- !ruby/object:Gem::Dependency
|
154
|
-
name: sass-rails-source-maps
|
155
|
-
requirement: !ruby/object:Gem::Requirement
|
156
|
-
requirements:
|
157
|
-
- - '='
|
158
|
-
- !ruby/object:Gem::Version
|
159
|
-
version: 0.0.4
|
160
|
-
type: :development
|
161
|
-
prerelease: false
|
162
|
-
version_requirements: !ruby/object:Gem::Requirement
|
163
|
-
requirements:
|
164
|
-
- - '='
|
165
|
-
- !ruby/object:Gem::Version
|
166
|
-
version: 0.0.4
|
167
153
|
- !ruby/object:Gem::Dependency
|
168
154
|
name: spring
|
169
155
|
requirement: !ruby/object:Gem::Requirement
|