yaml-translator 0.9.1 → 0.9.2
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/locale.rb +3 -1
- data/lib/yaml-translator/version.rb +1 -1
- data/spec/yaml-translator/translator_spec.rb +11 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ba16684fa000a47e86f4e74877d2852c36c1526b
|
4
|
+
data.tar.gz: ce7e0325cc35e11aadfddae1e85a6f7f1bb41734
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9b10fdffa997b6c0707d41e027963f02ec636197ecb2d21001fd792f707d819f59af6a20f4cccdb06b1f4f94f1dad21bc38063392ca0f7f540fc404cc5841daf
|
7
|
+
data.tar.gz: b102408618e93b9a56592b733ef90bf2aec962241b9873934e660258d3efb3de0afbafe0a4d3104d84a6ca53fd4a4e3cdc6bcd0df1c46f0b3d1e55cd18e399f5
|
data/Gemfile.lock
CHANGED
@@ -39,7 +39,9 @@ module YamlTranslator
|
|
39
39
|
key, text = *element.split(':')
|
40
40
|
[key, text.strip]
|
41
41
|
end
|
42
|
-
|
42
|
+
tree_hash = tree_of(Hash[diffs.compact])
|
43
|
+
tree_hash[lang] = {} if tree_hash.empty?
|
44
|
+
Locale.new(tree_hash)
|
43
45
|
end
|
44
46
|
|
45
47
|
def merge(other_locale)
|
@@ -41,4 +41,15 @@ describe YamlTranslator::Translator do
|
|
41
41
|
end
|
42
42
|
end
|
43
43
|
end
|
44
|
+
describe '#diff' do
|
45
|
+
let(:yaml_source) { yaml_contents(:en) }
|
46
|
+
context 'when diff nothing' do
|
47
|
+
context 'when ja' do
|
48
|
+
subject { translator.string(yaml_source).diff(yaml_source).to(:ja) }
|
49
|
+
it 'translate yaml string' do
|
50
|
+
expect(subject.lang).to eq(:ja)
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
44
55
|
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.9.
|
4
|
+
version: 0.9.2
|
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-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: easy_translate
|