tolk 3.0.1 → 3.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/tolk/locale.rb +7 -7
- data/lib/tolk/config.rb +5 -0
- data/lib/tolk/version.rb +1 -1
- data/lib/tolk/yaml.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a3b8241abe4dc3fb29b314cc2d10706ed44d87534bfca91938274f22b2efb6c3
|
4
|
+
data.tar.gz: ece4b7e9dd20ee3729a3ef3151fafd79e1aa24d1d7a87755d868853e3bf93b5e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a61d50cc51fc2902366b8a3afd1da39fbaebcb9b8ffdde5a7978252b492be160a11c0e6b3561637c750590cb2357ea954a78afe86cfced76c31f225df6ecfa84
|
7
|
+
data.tar.gz: 8c0f00f1862c654e5d55b59ad6c5579e5ea83068ff8dfe965c8453195f0d599b82ed9266aa032f1b35a8b600626190003b41ee615ccdddc21ced81bac0076867
|
data/app/models/tolk/locale.rb
CHANGED
@@ -153,14 +153,14 @@ module Tolk
|
|
153
153
|
end
|
154
154
|
|
155
155
|
def to_hash
|
156
|
-
data = translations.
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
end
|
156
|
+
data = translations.joins(:phrase).order("tolk_phrases.key ASC").pluck("tolk_phrases.key, text").
|
157
|
+
each_with_object(Hash.new(0)) do |translation, locale|
|
158
|
+
if translation[0].include?(".")
|
159
|
+
locale.deep_merge!(unsquish(translation[0], translation[1]))
|
160
|
+
else
|
161
|
+
locale[translation[0]] = translation[1]
|
163
162
|
end
|
163
|
+
end
|
164
164
|
{ name => data }
|
165
165
|
end
|
166
166
|
|
data/lib/tolk/config.rb
CHANGED
@@ -23,6 +23,9 @@ module Tolk
|
|
23
23
|
# strip translation texts automatically
|
24
24
|
attr_accessor :strip_texts
|
25
25
|
|
26
|
+
# specify line width which Yaml.dump will use to break lines. -1 for not breaking
|
27
|
+
attr_accessor :yaml_line_width
|
28
|
+
|
26
29
|
def reset
|
27
30
|
@exclude_gems_token = false
|
28
31
|
|
@@ -78,6 +81,8 @@ module Tolk
|
|
78
81
|
'zh-CN' => 'Chinese (Simplified)',
|
79
82
|
'zh-TW' => 'Chinese (Traditional)'
|
80
83
|
}
|
84
|
+
|
85
|
+
@yaml_line_width = Psych::Handler::OPTIONS.line_width # Psych::Handler::DumperOptions uses 0 as "default" for unset
|
81
86
|
end
|
82
87
|
end
|
83
88
|
|
data/lib/tolk/version.rb
CHANGED
data/lib/tolk/yaml.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tolk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Heinemeier Hansson
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date:
|
15
|
+
date: 2018-03-19 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: rails
|
@@ -179,7 +179,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
179
179
|
version: '0'
|
180
180
|
requirements: []
|
181
181
|
rubyforge_project:
|
182
|
-
rubygems_version: 2.7.
|
182
|
+
rubygems_version: 2.7.6
|
183
183
|
signing_key:
|
184
184
|
specification_version: 4
|
185
185
|
summary: Rails engine providing web interface for managing i18n yaml files
|