yaml-translator 0.8.3 → 0.8.4

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: fd1e5419f516c0e5808b709d17ebaf9571b952e2
4
- data.tar.gz: b049be4c6a92d7ef6892f79f760e249550170b54
3
+ metadata.gz: 6c3823177cd2f7fc6b6ac035050c40ee885962c9
4
+ data.tar.gz: 127e2ee94b6e7424827ffbe1504a8813d5d6c075
5
5
  SHA512:
6
- metadata.gz: 5e2719bbd14f5ed9266aac27ea12b129447750c6bbcdbf4d35237bba1bc0111cf3a759b6d3d60ba4a72f61a9e927461075b16ae1cbbda4a01a5a024f53f1ebb7
7
- data.tar.gz: aab388c974f11d9962ebc53e2545839ff580371a7e4ebd9289624e97f3ff4851e70423d4b246c86dc0fd69090ddd5afd57ba1372028c5b73e6c80f6eed7550f9
6
+ metadata.gz: bf35cb1c0a3c2b55bdf0d30e1c2d6c29108479beccc2400ffcb52373206f96c2a815de35c96e551b9a1eef95501795b83bc1c89f31a91a6989e7dd38f98cb31c
7
+ data.tar.gz: 9a610c0172e17f92cfd0eb42290d95fcd6d9d35d561410e053961d54722160157030857d47a3c5a406d851e42b31bbe5c684c76758c1a08dfee828514a1171ad
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- yaml-translator (0.8.3)
4
+ yaml-translator (0.8.4)
5
5
  diff-lcs
6
6
  easy_translate
7
7
 
@@ -1,3 +1,3 @@
1
1
  module YamlTranslator
2
- VERSION = '0.8.3'
2
+ VERSION = '0.8.4'
3
3
  end
@@ -0,0 +1,7 @@
1
+ ---
2
+ zh-CN:
3
+ bar: bar
4
+ foo: foo
5
+ foo1:
6
+ foo1: foo1-1
7
+ foo2: foo1-2
@@ -1,22 +1,44 @@
1
1
  describe YamlTranslator::Translator do
2
2
  let(:translator) { YamlTranslator::Translator.new }
3
3
  describe '#file' do
4
- let(:path) { yaml_path(:ja) }
5
- let(:expected_locale) { YamlTranslator::Locale.load_file(path) }
6
- it 'translate files' do
7
- result = translator.file(path).to(:ja)
8
- expect(result.lang).to eq(:ja)
9
- expect(result.values).to eq(expected_locale.values)
4
+ context 'when ja' do
5
+ let(:path) { yaml_path(:ja) }
6
+ let(:expected_locale) { YamlTranslator::Locale.load_file(path) }
7
+ it 'translate files' do
8
+ result = translator.file(path).to(:ja)
9
+ expect(result.lang).to eq(:ja)
10
+ expect(result.values).to eq(expected_locale.values)
11
+ end
12
+ end
13
+ context 'when zh-CN' do
14
+ let(:path) { yaml_path(:'zh-CN') }
15
+ let(:expected_locale) { YamlTranslator::Locale.load_file(path) }
16
+ it 'translate files' do
17
+ result = translator.file(path).to(:'zh-CN')
18
+ expect(result.lang).to eq(:'zh-CN')
19
+ expect(result.values).to eq(expected_locale.values)
20
+ end
10
21
  end
11
22
  end
12
23
  describe '#string' do
13
- let(:path) { yaml_path(:ja) }
14
24
  let(:yaml_source) { yaml_contents(:en) }
15
- let(:expected_locale) { YamlTranslator::Locale.load_file(path) }
16
- it 'translate yaml string' do
17
- result = translator.string(yaml_source).to(:ja)
18
- expect(result.lang).to eq(:ja)
19
- expect(result.values).to eq(expected_locale.values)
25
+ context 'when ja' do
26
+ let(:path) { yaml_path(:ja) }
27
+ let(:expected_locale) { YamlTranslator::Locale.load_file(path) }
28
+ it 'translate yaml string' do
29
+ result = translator.string(yaml_source).to(:ja)
30
+ expect(result.lang).to eq(:ja)
31
+ expect(result.values).to eq(expected_locale.values)
32
+ end
33
+ end
34
+ context 'when zh-CN' do
35
+ let(:path) { yaml_path(:'zh-CN') }
36
+ let(:expected_locale) { YamlTranslator::Locale.load_file(path) }
37
+ it 'translate yaml string' do
38
+ result = translator.string(yaml_source).to(:'zh-CN')
39
+ expect(result.lang).to eq(:'zh-CN')
40
+ expect(result.values).to eq(expected_locale.values)
41
+ end
20
42
  end
21
43
  end
22
44
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yaml-translator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.3
4
+ version: 0.8.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Noritaka Horio
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-09 00:00:00.000000000 Z
11
+ date: 2017-02-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: easy_translate
@@ -175,6 +175,7 @@ files:
175
175
  - spec/fixtures/en.yml
176
176
  - spec/fixtures/ja.yml
177
177
  - spec/fixtures/merge_target.yml
178
+ - spec/fixtures/zh-CN.yml
178
179
  - spec/helpers/locale_helper.rb
179
180
  - spec/spec_helper.rb
180
181
  - spec/yaml-translator/locale_spec.rb
@@ -213,6 +214,7 @@ test_files:
213
214
  - spec/fixtures/en.yml
214
215
  - spec/fixtures/ja.yml
215
216
  - spec/fixtures/merge_target.yml
217
+ - spec/fixtures/zh-CN.yml
216
218
  - spec/helpers/locale_helper.rb
217
219
  - spec/spec_helper.rb
218
220
  - spec/yaml-translator/locale_spec.rb