air18n 0.4.9 → 0.4.10
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/air18n/class_methods.rb +5 -0
- data/lib/air18n/version.rb +1 -1
- metadata +2 -2
data/lib/air18n/class_methods.rb
CHANGED
@@ -46,10 +46,15 @@ module Air18n
|
|
46
46
|
#
|
47
47
|
# Returns what the block returns.
|
48
48
|
#
|
49
|
+
# If locale is blank, leaves I18n.full_locale unaffected.
|
50
|
+
#
|
49
51
|
# Useful for tests or where you want to render something in a
|
50
52
|
# certain language without the side-effect of changing
|
51
53
|
# I18n.full_locale.
|
52
54
|
def run_in_locale(locale)
|
55
|
+
# Be robust to people passing in nil locale.
|
56
|
+
locale ||= I18n.default_locale
|
57
|
+
|
53
58
|
old_locale = I18n.full_locale
|
54
59
|
I18n.full_locale = locale
|
55
60
|
ret = yield
|
data/lib/air18n/version.rb
CHANGED
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.4.
|
4
|
+
version: 0.4.10
|
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: 2013-05-
|
16
|
+
date: 2013-05-22 00:00:00.000000000 Z
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|
19
19
|
name: i18n
|