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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/yaml-translator/version.rb +1 -1
- data/spec/fixtures/zh-CN.yml +7 -0
- data/spec/yaml-translator/translator_spec.rb +34 -12
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6c3823177cd2f7fc6b6ac035050c40ee885962c9
|
4
|
+
data.tar.gz: 127e2ee94b6e7424827ffbe1504a8813d5d6c075
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bf35cb1c0a3c2b55bdf0d30e1c2d6c29108479beccc2400ffcb52373206f96c2a815de35c96e551b9a1eef95501795b83bc1c89f31a91a6989e7dd38f98cb31c
|
7
|
+
data.tar.gz: 9a610c0172e17f92cfd0eb42290d95fcd6d9d35d561410e053961d54722160157030857d47a3c5a406d851e42b31bbe5c684c76758c1a08dfee828514a1171ad
|
data/Gemfile.lock
CHANGED
@@ -1,22 +1,44 @@
|
|
1
1
|
describe YamlTranslator::Translator do
|
2
2
|
let(:translator) { YamlTranslator::Translator.new }
|
3
3
|
describe '#file' do
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
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
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
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.
|
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-
|
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
|