motion_i18n 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/motion_i18n/i18n.rb +5 -0
- data/lib/motion_i18n/version.rb +1 -1
- metadata +1 -1
data/lib/motion_i18n/i18n.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
module I18n
|
2
2
|
def self.set_locale(locale)
|
3
|
+
remove_locale
|
3
4
|
NSUserDefaults.standardUserDefaults.setObject([locale], forKey: "AppleLanguages")
|
4
5
|
NSUserDefaults.standardUserDefaults.synchronize
|
5
6
|
end
|
@@ -7,4 +8,8 @@ module I18n
|
|
7
8
|
def self.current_locale
|
8
9
|
NSLocale.preferredLanguages.objectAtIndex(0)
|
9
10
|
end
|
11
|
+
|
12
|
+
def self.unset_locale
|
13
|
+
NSUserDefaults.standardUserDefaults.removeObjectForKey("AppleLanguages")
|
14
|
+
end
|
10
15
|
end
|
data/lib/motion_i18n/version.rb
CHANGED