refinerycms-i18n 0.9.8.8 → 0.9.8.11

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.
data/lib/gemspec.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
- version = '0.9.8.8'
2
+ version = '0.9.8.11'
3
3
  raise "Could not get version so gemspec can not be built" if version.nil?
4
4
  files = Dir.glob("**/*").flatten.reject do |file|
5
5
  file =~ /\.gem(spec)?$/
data/lib/refinery/i18n.rb CHANGED
@@ -130,7 +130,8 @@ module Refinery
130
130
  :'zh-CN' => 'Simple Chinese',
131
131
  :de => 'Deutsch',
132
132
  :lv => 'Latviski',
133
- :ru => 'Русский'
133
+ :ru => 'Русский',
134
+ :sv => 'Svenska'
134
135
  },
135
136
  {
136
137
  :scoping => 'refinery',
@@ -155,6 +156,25 @@ module Refinery
155
156
  self.load_refinery_locales!
156
157
  self.load_app_locales!
157
158
  self.set_default_locale!
159
+ self.ensure_locales_up_to_date!
160
+ end
161
+
162
+ def ensure_locales_up_to_date!
163
+ # ensure running latest locales (this is awfully brittle).
164
+ locales = if Refinery.version >= '0.9.9'
165
+ RefinerySetting.get(:i18n_translation_locales, :scoping => 'refinery')
166
+ else
167
+ RefinerySetting.find_by_name_and_scoping('i18n_translation_locales', 'refinery').try(:value)
168
+ end
169
+
170
+ if locales.present? and locales.is_a?(Hash) and locales.keys.exclude?(:sv)
171
+ value = {:value => nil, :scoping => 'refinery'}
172
+ if RefinerySetting.respond_to?(:set)
173
+ RefinerySetting.set(:i18n_translation_locales, value)
174
+ else
175
+ RefinerySetting[:i18n_translation_locales] = value
176
+ end
177
+ end
158
178
  end
159
179
 
160
180
  def load_base_locales!
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: refinerycms-i18n
3
3
  version: !ruby/object:Gem::Version
4
- hash: 55
4
+ hash: 49
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 9
9
9
  - 8
10
- - 8
11
- version: 0.9.8.8
10
+ - 11
11
+ version: 0.9.8.11
12
12
  platform: ruby
13
13
  authors:
14
14
  - Resolve Digital
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2010-10-08 00:00:00 +13:00
19
+ date: 2010-11-15 00:00:00 +13:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
@@ -134,7 +134,6 @@ files:
134
134
  - lib/translate/log.rb
135
135
  - lib/translate/storage.rb
136
136
  - Rakefile
137
- - REFINERY_README
138
137
  - test/i18n-test.html
139
138
  - test/i18n-test.js
140
139
  - test/i18n_js_test.rb
data/REFINERY_README DELETED
@@ -1,8 +0,0 @@
1
- Installed from moretea/translate
2
- script/plugin install git://github.com/moretea/translate.git
3
-
4
- This is handy for translating refinery to other languages.
5
-
6
- $ rake translate:lost_in_translation LOCALE=nl
7
-
8
- Run this task to get a list of missing translations