motion_i18n 0.0.2 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -1,15 +1,7 @@
1
1
  require "bundler/gem_tasks"
2
2
  $:.unshift("/Library/RubyMotion/lib")
3
3
  require 'motion/project'
4
-
5
-
6
- ['i18n', 'motion_i18n/version', 'motion_i18n/i18n'].each do |f|
7
- require File.join(File.dirname(__FILE__), 'lib/'+f)
8
- end
9
-
10
-
11
- Motion::Project::App.setup do |app|
12
- Dir.glob(File.join(File.dirname(__FILE__), 'lib/motion_i18n/*.rb')).each do |file|
13
- app.files.unshift(file)
14
- end
15
- end
4
+ Bundler.setup
5
+ Bundler.require
6
+ require 'rubygems'
7
+ require File.join(File.dirname(__FILE__), 'lib/motion_i18n')
@@ -0,0 +1,9 @@
1
+ Motion::Project::App.setup do |app|
2
+ Dir.glob(File.join(File.dirname(__FILE__), 'motion_i18n/*.rb')).each do |file|
3
+ app.files.unshift(file)
4
+ end
5
+ end
6
+ module I18n
7
+ end
8
+
9
+ require 'motion_i18n/i18n'
@@ -1,15 +1,21 @@
1
1
  module I18n
2
2
  def self.set_locale(locale)
3
- remove_locale
3
+ I18n::Locale.unset_locale
4
4
  NSUserDefaults.standardUserDefaults.setObject([locale], forKey: "AppleLanguages")
5
5
  NSUserDefaults.standardUserDefaults.synchronize
6
+ I18n::Locale.current_locale
6
7
  end
7
-
8
+
8
9
  def self.current_locale
9
10
  NSLocale.preferredLanguages.objectAtIndex(0)
10
11
  end
11
-
12
+
12
13
  def self.unset_locale
13
14
  NSUserDefaults.standardUserDefaults.removeObjectForKey("AppleLanguages")
15
+ true
14
16
  end
15
17
  end
18
+
19
+
20
+
21
+
@@ -1,3 +1,3 @@
1
- module MotionI18n
2
- VERSION = "0.0.2"
1
+ module I18n
2
+ VERSION = "0.0.4"
3
3
  end
data/motion_i18n.gemspec CHANGED
@@ -3,7 +3,7 @@ require File.expand_path('../lib/motion_i18n/version', __FILE__)
3
3
 
4
4
  Gem::Specification.new do |gem|
5
5
  gem.name = "motion_i18n"
6
- gem.version = MotionI18n::VERSION
6
+ gem.version = I18n::VERSION
7
7
  gem.authors = ["Scott Ballantyne"]
8
8
  gem.email = ["ussballantyne@gmail.com"]
9
9
  gem.description = %q{start of a I18n lib for ruby motion}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: motion_i18n
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -23,7 +23,7 @@ files:
23
23
  - LICENSE.txt
24
24
  - README.md
25
25
  - Rakefile
26
- - lib/i18n.rb
26
+ - lib/motion_i18n.rb
27
27
  - lib/motion_i18n/i18n.rb
28
28
  - lib/motion_i18n/version.rb
29
29
  - motion_i18n.gemspec
@@ -39,12 +39,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
39
39
  - - ! '>='
40
40
  - !ruby/object:Gem::Version
41
41
  version: '0'
42
+ segments:
43
+ - 0
44
+ hash: -1263502838364877024
42
45
  required_rubygems_version: !ruby/object:Gem::Requirement
43
46
  none: false
44
47
  requirements:
45
48
  - - ! '>='
46
49
  - !ruby/object:Gem::Version
47
50
  version: '0'
51
+ segments:
52
+ - 0
53
+ hash: -1263502838364877024
48
54
  requirements: []
49
55
  rubyforge_project:
50
56
  rubygems_version: 1.8.24
data/lib/i18n.rb DELETED
@@ -1,3 +0,0 @@
1
- module I18n
2
-
3
- end