r18n-desktop 1.1.11 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/r18n-desktop/java.rb +0 -1
- data/lib/r18n-desktop/osx.rb +0 -1
- data/lib/r18n-desktop/posix.rb +0 -1
- data/lib/r18n-desktop/win32.rb +9 -22
- data/lib/r18n-desktop.rb +0 -1
- data/r18n-desktop.gemspec +5 -4
- data/spec/r18n-desktop_spec.rb +9 -11
- data/spec/spec_helper.rb +0 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c632c2f116e3e1876767da781d3ca9a876fd4c9a
|
4
|
+
data.tar.gz: 3c1368f76219f1c0473eaf2a29fb654314987692
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c969a98f493c8202e1f9e361d12658b6714dd799e18a5be43ba2df4e46378c13aa3775b3a7f76373b781f34eba9e4241196b05b50e7efece70515272a3d26071
|
7
|
+
data.tar.gz: 0fbcac6c81fd603caa01b046c6e454a89ab27d6c0619c8ddcafa461bb0cfe8ac661971728a488b873676a7724ded54e453b3051ecc280bb8eb6ee85a3466533a
|
data/lib/r18n-desktop/java.rb
CHANGED
data/lib/r18n-desktop/osx.rb
CHANGED
data/lib/r18n-desktop/posix.rb
CHANGED
data/lib/r18n-desktop/win32.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
# encoding: utf-8
|
2
1
|
=begin
|
3
2
|
I18n support for Windows.
|
4
3
|
|
@@ -18,31 +17,19 @@ You should have received a copy of the GNU Lesser General Public License
|
|
18
17
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
19
18
|
=end
|
20
19
|
|
21
|
-
|
22
|
-
if RUBY_VERSION < '1.9'
|
23
|
-
require 'dl/win32'
|
24
|
-
else
|
25
|
-
require 'dl/import'
|
26
|
-
end
|
20
|
+
require 'dl/import'
|
27
21
|
|
28
22
|
module R18n
|
29
23
|
class I18n
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
else
|
36
|
-
module Kernel32
|
37
|
-
extend DL::Importer
|
38
|
-
dlload 'Kernel32'
|
39
|
-
extern 'int GetUserDefaultLangID()'
|
40
|
-
end
|
24
|
+
module Kernel32
|
25
|
+
extend DL::Importer
|
26
|
+
dlload 'Kernel32'
|
27
|
+
extern 'int GetUserDefaultLangID()'
|
28
|
+
end
|
41
29
|
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
end
|
30
|
+
def self.system_locale
|
31
|
+
id = Kernel32.GetUserDefaultLangID()
|
32
|
+
WIN32_LOCALES[id]
|
46
33
|
end
|
47
34
|
|
48
35
|
WIN32_LOCALES = {
|
data/lib/r18n-desktop.rb
CHANGED
data/r18n-desktop.gemspec
CHANGED
@@ -2,10 +2,11 @@ require File.expand_path('../../r18n-core/lib/r18n-core/version', __FILE__)
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.platform = Gem::Platform::RUBY
|
5
|
-
s.name
|
6
|
-
s.version
|
7
|
-
s.date
|
8
|
-
|
5
|
+
s.name = 'r18n-desktop'
|
6
|
+
s.version = R18n::VERSION.dup
|
7
|
+
s.date = Time.now.strftime('%Y-%m-%d')
|
8
|
+
|
9
|
+
s.summary = 'A i18n tool to translate your Ruby desktop application.'
|
9
10
|
s.description = <<-EOF
|
10
11
|
A i18n tool to translate your desktop application in several languages.
|
11
12
|
It is just a wrapper for R18n core library.
|
data/spec/r18n-desktop_spec.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
# encoding: utf-8
|
2
1
|
require File.expand_path('../spec_helper', __FILE__)
|
3
2
|
|
4
3
|
describe "r18n-desktop" do
|
@@ -10,28 +9,27 @@ describe "r18n-desktop" do
|
|
10
9
|
|
11
10
|
it "returns array of system locales" do
|
12
11
|
locale = R18n::I18n.system_locale
|
13
|
-
locale.class.
|
14
|
-
locale.
|
12
|
+
expect(locale.class).to eq String
|
13
|
+
expect(locale).not_to be_empty
|
15
14
|
end
|
16
15
|
|
17
16
|
it "loads I18n from system environment" do
|
18
17
|
R18n.from_env
|
19
|
-
r18n.class.
|
20
|
-
r18n.locale.
|
21
|
-
R18n.get.
|
18
|
+
expect(r18n.class).to eq R18n::I18n
|
19
|
+
expect(r18n.locale).not_to be_empty if String == r18n.locale.class
|
20
|
+
expect(R18n.get).to eq r18n
|
22
21
|
end
|
23
22
|
|
24
23
|
it "loads i18n from system environment using specified order" do
|
25
24
|
R18n.from_env(nil, 'en')
|
26
|
-
r18n.locale.
|
27
|
-
R18n.get.
|
25
|
+
expect(r18n.locale).to eq R18n.locale('en')
|
26
|
+
expect(R18n.get).to eq r18n
|
28
27
|
end
|
29
28
|
|
30
29
|
it "allows to overide autodetect by LANG environment" do
|
31
|
-
R18n::I18n.
|
30
|
+
allow(R18n::I18n).to receive(:system_locale) { 'ru' }
|
32
31
|
ENV['LANG'] = 'en'
|
33
32
|
R18n.from_env
|
34
|
-
r18n.locale.
|
33
|
+
expect(r18n.locale).to eq R18n.locale('en')
|
35
34
|
end
|
36
|
-
|
37
35
|
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: r18n-desktop
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrey Sitnik
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-05
|
11
|
+
date: 2014-12-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: r18n-core
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 2.0.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 2.0.0
|
27
27
|
description: |2
|
28
28
|
A i18n tool to translate your desktop application in several languages.
|
29
29
|
It is just a wrapper for R18n core library.
|