r18n-desktop 0.4.6 → 0.4.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -21,7 +21,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
21
21
  module R18n
22
22
  class I18n
23
23
  def self.system_locale
24
- java.util.Locale.getDefault.toString
24
+ Java.java.util.Locale.getDefault.toString
25
25
  end
26
26
  end
27
27
  end
@@ -18,13 +18,31 @@ You should have received a copy of the GNU Lesser General Public License
18
18
  along with this program. If not, see <http://www.gnu.org/licenses/>.
19
19
  =end
20
20
 
21
- require 'dl/win32'
21
+ # Win32API is deprecated as of 1.9.1
22
+ if RUBY_VERSION < '1.9'
23
+ require 'dl/win32'
24
+ else
25
+ require 'dl/import'
26
+ end
22
27
 
23
28
  module R18n
24
29
  class I18n
25
- def self.system_locale
26
- id = Win32API.new("kernel32.dll", "GetUserDefaultLangID", nil, "i").call
27
- WIN32_LOCALES[id]
30
+ if RUBY_VERSION < '1.9'
31
+ def self.system_locale
32
+ id = Win32API.new('kernel32.dll', 'GetUserDefaultLangID', nil, 'i').call
33
+ WIN32_LOCALES[id]
34
+ end
35
+ else
36
+ module Kernel32
37
+ extend DL::Importer
38
+ dlload 'Kernel32'
39
+ extern 'int GetUserDefaultLangID()'
40
+ end
41
+
42
+ def self.system_locale
43
+ id = Kernel32.GetUserDefaultLangID()
44
+ WIN32_LOCALES[id]
45
+ end
28
46
  end
29
47
 
30
48
  WIN32_LOCALES = {
metadata CHANGED
@@ -1,12 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: r18n-desktop
3
3
  version: !ruby/object:Gem::Version
4
+ hash: 1
4
5
  prerelease: false
5
6
  segments:
6
7
  - 0
7
8
  - 4
8
- - 6
9
- version: 0.4.6
9
+ - 7
10
+ version: 0.4.7
10
11
  platform: ruby
11
12
  authors:
12
13
  - Andrey "A.I." Sitnik
@@ -14,21 +15,23 @@ autorequire:
14
15
  bindir: bin
15
16
  cert_chain: []
16
17
 
17
- date: 2010-06-22 00:00:00 +04:00
18
+ date: 2010-08-07 00:00:00 +04:00
18
19
  default_executable:
19
20
  dependencies:
20
21
  - !ruby/object:Gem::Dependency
21
22
  name: r18n-core
22
23
  prerelease: false
23
24
  requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
24
26
  requirements:
25
27
  - - "="
26
28
  - !ruby/object:Gem::Version
29
+ hash: 1
27
30
  segments:
28
31
  - 0
29
32
  - 4
30
- - 6
31
- version: 0.4.6
33
+ - 7
34
+ version: 0.4.7
32
35
  type: :runtime
33
36
  version_requirements: *id001
34
37
  description: " A i18n tool to translate your desktop application in several languages.\n It is just a wrapper for R18n core library.\n It has nice Ruby-style syntax, filters, flexible locales, custom loaders,\n translation support for any classes, time and number localization, several\n user language support, agnostic core package with out-of-box support for\n Rails, Sinatra, Merb and desktop applications.\n"
@@ -47,6 +50,8 @@ files:
47
50
  - lib/r18n-desktop/win32.rb
48
51
  - LICENSE
49
52
  - README.rdoc
53
+ - spec/r18n-desktop_spec.rb
54
+ - spec/spec_helper.rb
50
55
  has_rdoc: true
51
56
  homepage: http://r18n.rubyforge.org/
52
57
  licenses: []
@@ -57,23 +62,27 @@ rdoc_options: []
57
62
  require_paths:
58
63
  - lib
59
64
  required_ruby_version: !ruby/object:Gem::Requirement
65
+ none: false
60
66
  requirements:
61
67
  - - ">="
62
68
  - !ruby/object:Gem::Version
69
+ hash: 3
63
70
  segments:
64
71
  - 0
65
72
  version: "0"
66
73
  required_rubygems_version: !ruby/object:Gem::Requirement
74
+ none: false
67
75
  requirements:
68
76
  - - ">="
69
77
  - !ruby/object:Gem::Version
78
+ hash: 3
70
79
  segments:
71
80
  - 0
72
81
  version: "0"
73
82
  requirements: []
74
83
 
75
84
  rubyforge_project: r18n-desktop
76
- rubygems_version: 1.3.6
85
+ rubygems_version: 1.3.7
77
86
  signing_key:
78
87
  specification_version: 3
79
88
  summary: A i18n tool to translate your Ruby desktop application.