r18n-rails-api 2.0.1 → 2.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d5fc36121b01d8326812392e2e2484d3b75f271f
4
- data.tar.gz: 055d61b4dc1d66e7924b0450397f1df173bea289
3
+ metadata.gz: ecdf047435737bcb5ad19884a4ff3104e8854cab
4
+ data.tar.gz: 5a41433226ad008c4446fc0320b89bf5218b04fb
5
5
  SHA512:
6
- metadata.gz: 1b69ff0b0644af467f340ba2d34a7af92408b472d8e3fe655a1b8c2ac2bb3b56fc44273793d68596b2d83a5148f3ff294dd3327c3272959f18cf3a36920fdece
7
- data.tar.gz: c3899e8ef0dc89a0fc12d41bb57176ad81c24f65411b3bee3233b5f29699397f10ef8c8f5ddefe7a2504670df99b5ded67fd777b4bc976bf62f9d450c1726679
6
+ metadata.gz: 7389fa957747f362d4daaaed47ffca4cbc98f314353917bc7449ae69c198fe5858efd5fa0c2c14075b820166429edbadf867775056f2bb5ceb36ff98f10af109
7
+ data.tar.gz: cb406e2360208cc5e9450c61e0e5caf0120a86ceeef90c69a422268fb93e418f0b87b4858d7a5bbe7814f5ea465f18466615084ef8e294c552949231e4a62948
@@ -51,7 +51,7 @@ module R18n
51
51
  def load(locale)
52
52
  initialize_types
53
53
  reload!
54
- @translations[locale.code.downcase]
54
+ @translations[locale.code]
55
55
  end
56
56
 
57
57
  # Reload backend if <tt>I18n.load_path</tt> is changed.
@@ -0,0 +1,2 @@
1
+ de-CH:
2
+ a: 1
@@ -7,13 +7,17 @@ describe R18n::Loader::Rails do
7
7
  end
8
8
 
9
9
  it "returns available locales" do
10
- expect(@loader.available).to match_array([EN, RU])
10
+ expect(@loader.available).to match_array([DECH, EN, RU])
11
11
  end
12
12
 
13
13
  it "loads translation" do
14
14
  expect(@loader.load(RU)).to eq({ 'one' => 'Один', 'two' => 'Два' })
15
15
  end
16
16
 
17
+ it "loads translation for dialects" do
18
+ expect(@loader.load(DECH)).to eq({ 'a' => 1 })
19
+ end
20
+
17
21
  it "changes pluralization" do
18
22
  expect(@loader.load(EN)).to eq({
19
23
  'users' => R18n::Typed.new('pl', {
@@ -6,8 +6,9 @@ I18n.enforce_available_locales = true
6
6
 
7
7
  require File.join(File.dirname(__FILE__), '../lib/r18n-rails-api')
8
8
 
9
- EN = R18n.locale(:en)
10
- RU = R18n.locale(:ru)
9
+ EN = R18n.locale(:en)
10
+ RU = R18n.locale(:ru)
11
+ DECH = R18n.locale(:'de-CH')
11
12
 
12
13
  GENERAL = Dir.glob(File.join(File.dirname(__FILE__), 'data/general/*'))
13
14
  SIMPLE = Dir.glob(File.join(File.dirname(__FILE__), 'data/simple/*'))
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: r18n-rails-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 2.0.2
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-12-08 00:00:00.000000000 Z
11
+ date: 2014-12-17 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: 2.0.1
19
+ version: 2.0.2
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: 2.0.1
26
+ version: 2.0.2
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: i18n
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -68,6 +68,7 @@ files:
68
68
  - spec/data/other/en.yml
69
69
  - spec/data/other/ru.yml
70
70
  - spec/data/pl/ru.yml
71
+ - spec/data/simple/de-CH.yml
71
72
  - spec/data/simple/en.yml
72
73
  - spec/data/simple/ru.rb
73
74
  - spec/data/simple/russian.yml
@@ -105,6 +106,7 @@ test_files:
105
106
  - spec/data/other/en.yml
106
107
  - spec/data/other/ru.yml
107
108
  - spec/data/pl/ru.yml
109
+ - spec/data/simple/de-CH.yml
108
110
  - spec/data/simple/en.yml
109
111
  - spec/data/simple/ru.rb
110
112
  - spec/data/simple/russian.yml