air18n 0.1.28 → 0.1.29

Sign up to get free protection for your applications and to get access to all the features.
@@ -78,9 +78,14 @@ module Air18n
78
78
  # When TranslateController makes a new translation, it sets
79
79
  # translations_last_updated_at to the current time in the cache.
80
80
  # If we haven't reset the i18n backends since then, we take the opportunity to reset them.
81
- last_updated_at = Rails.cache.read("#{locale}_translations_last_updated_at")
82
- if last_updated_at && last_updated_at.to_i > @translations_last_loaded_at[locale].to_i
83
- reload_translations([locale])
81
+
82
+ # No-op if locale is the default locale; its translations never change.
83
+ if locale != I18n.default_locale
84
+ # TODO(jkb, sri) Add a layer of abstraction between air18n and Rails.cache.
85
+ last_updated_at = Rails.cache.read("#{locale}_translations_last_updated_at")
86
+ if last_updated_at && last_updated_at.to_i > @translations_last_loaded_at[locale].to_i
87
+ reload_translations([locale])
88
+ end
84
89
  end
85
90
  end
86
91
 
@@ -1,3 +1,3 @@
1
1
  module Air18n
2
- VERSION = "0.1.28"
2
+ VERSION = "0.1.29"
3
3
  end
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.28
4
+ version: 0.1.29
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ authors:
13
13
  autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
- date: 2012-11-10 00:00:00.000000000 Z
16
+ date: 2012-11-13 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: i18n