air18n 0.1.50 → 0.1.51

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.
@@ -185,7 +185,9 @@ module Air18n
185
185
  default = options[:default] && options[:default].is_a?(String) && options[:default]
186
186
  overrides_previous_default = !options[:default_is_low_priority]
187
187
 
188
- init_translations(locale)
188
+ I18n.fallbacks_for(locale).each do |l|
189
+ init_translations(l)
190
+ end
189
191
 
190
192
  # Only create new screenshots while using default locale, and ignore keys
191
193
  # that come in hash format or with a wacky namespace
@@ -1,3 +1,3 @@
1
1
  module Air18n
2
- VERSION = "0.1.50"
2
+ VERSION = "0.1.51"
3
3
  end
@@ -79,17 +79,19 @@ describe Air18n::Backend do
79
79
  it 'should lazily load all translations on startup' do
80
80
  @backend = Air18n::Backend.new
81
81
  @backend.available_locales.should be_empty
82
+
83
+ # Requesting es-419 translation causes loading of both es-419 and
84
+ # es translations.
85
+ @backend.lookup(:"es-419", @phrase1.key).should == 'Spanish value 1'
82
86
  @backend.lookup(:es, @phrase1.key).should == 'Spanish value 1'
87
+
83
88
  @backend.lookup(:fr, @phrase1.key).should == 'French value 1'
84
89
  @backend.lookup(:es, @phrase2.key).should == 'Spanish value 2'
85
90
 
86
- # This is undesirable behavior. Before any English lookup has been done,
87
- # English translations aren't loaded.
88
- @backend.lookup(:ko, @phrase1.key).should == nil
89
-
90
- @backend.lookup(:en, @phrase1.key).should == 'value 1'
91
+ # No Korean translation, so falls back to English, which should
92
+ # have been lazily loaded already.
91
93
  @backend.lookup(:ko, @phrase1.key).should == 'value 1'
92
- @backend.lookup(:en, @phrase2.key).should == 'value 2'
94
+
93
95
  @backend.available_locales.size.should == 3
94
96
  end
95
97
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: air18n
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.50
4
+ version: 0.1.51
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: