yaml-translator 0.9.0 → 0.9.1
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 +7 -6
- data/lib/yaml-translator/version.rb +1 -1
- 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: a4a2bedcfad980cb1ab2ad7d978ef33b70f374dc
|
4
|
+
data.tar.gz: eaab328e29e901828161d2c2795e2d012b71e307
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2dbcdfb27b69d1edc807d4fca2bf24cf0b472551a9db09900c7e4f7a3416ee66882ef8278b63ea7852529dd039b5b91f492d831df9ed113677ecf3fc53b4760d
|
7
|
+
data.tar.gz: 13035e4281a00fd05826585cee9780e753181cd140422fe4ff3aa0d796c1fc4feb8bdc250dd5a9ab9aa2bb4447290d3b90f72f0970cb41fb39ad3d5cc3f25d04
|
data/Gemfile.lock
CHANGED
@@ -21,12 +21,13 @@ module YamlTranslator
|
|
21
21
|
@lang = config.keys.first.to_sym # FIXME check support language
|
22
22
|
end
|
23
23
|
|
24
|
+
def locale_texts
|
25
|
+
self[lang]
|
26
|
+
end
|
27
|
+
|
24
28
|
def translate(translator, options={})
|
25
|
-
|
26
|
-
|
27
|
-
translated_values = translator.translate(compact_of(values[@lang]), options)
|
28
|
-
result[options[:to]] = tree_of(translated_values)
|
29
|
-
Locale.new(result)
|
29
|
+
translated_values = translator.translate(compact_of(locale_texts), options)
|
30
|
+
Locale.new(Hash[*[options[:to], tree_of(translated_values)]])
|
30
31
|
end
|
31
32
|
|
32
33
|
def diff(other_locale)
|
@@ -75,7 +76,7 @@ module YamlTranslator
|
|
75
76
|
end
|
76
77
|
|
77
78
|
def to_s
|
78
|
-
YAML.dump(
|
79
|
+
YAML.dump(Hash[*[lang.to_s, locale_texts]])
|
79
80
|
end
|
80
81
|
|
81
82
|
private
|
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.1
|
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-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: easy_translate
|