translations_sync 0.4.7 → 0.4.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Changelog +4 -1
- data/Rakefile +1 -1
- data/lib/translations_sync.rb +2 -7
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ba6982180a2cb156ce7ad31ed13358fe208e6fad
|
|
4
|
+
data.tar.gz: 303d47cab7eec3dbbf153d7b8cc1a55d3a6fc4de
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 90d7353bcd62190d7895a6deb0c22400100d5c87e0587b020ec3f0fdbf12747c5e8d1cf3cebe7c0bbafe3d5fb7c0877c6d885171fafcaaffbcd88967faff04f4
|
|
7
|
+
data.tar.gz: dc0936234b8ff899c9498e4a89e61ee3bd7867d46284f940da260af52d5369bf319a7c8933e529d24a27528f4bb42f4bfbda74cbf9441d32d04f4a5cce71a015
|
data/Changelog
CHANGED
data/Rakefile
CHANGED
data/lib/translations_sync.rb
CHANGED
|
@@ -189,17 +189,14 @@ class TranslationsSync
|
|
|
189
189
|
destination ||= ''
|
|
190
190
|
destination = destination.split('.').map(&:to_sym)
|
|
191
191
|
destination << key.last if destination.size == 0
|
|
192
|
-
puts "key=#{key.inspect} destination=#{destination.inspect}"
|
|
193
192
|
result = false
|
|
194
193
|
flat.each_pair do |array, val|
|
|
195
194
|
if array[0, key_length] == key
|
|
196
195
|
array[0, key_length] = destination
|
|
197
|
-
puts array.inspect
|
|
198
196
|
result = true
|
|
199
197
|
end
|
|
200
198
|
end
|
|
201
199
|
@moved = nil
|
|
202
|
-
puts result
|
|
203
200
|
result
|
|
204
201
|
end
|
|
205
202
|
|
|
@@ -210,7 +207,6 @@ class TranslationsSync
|
|
|
210
207
|
@moved[lang] = {}
|
|
211
208
|
end
|
|
212
209
|
flat.each_pair do |key, val|
|
|
213
|
-
puts key.inspect
|
|
214
210
|
val.keys.each do |lang|
|
|
215
211
|
push_to_hash @moved[lang], lang, key, val, :moved
|
|
216
212
|
end
|
|
@@ -299,8 +295,7 @@ class TranslationsSync
|
|
|
299
295
|
begin
|
|
300
296
|
h[key.to_s] = val[lang].to_s + TAIL
|
|
301
297
|
rescue
|
|
302
|
-
|
|
303
|
-
raise
|
|
298
|
+
raise %Q(Can not assign to the key "#{keys.inspect}" value "#{val[lang]} for language #{target}")
|
|
304
299
|
end
|
|
305
300
|
end
|
|
306
301
|
when :singles
|
|
@@ -309,7 +304,7 @@ class TranslationsSync
|
|
|
309
304
|
h[key.to_s] = value
|
|
310
305
|
when :moved
|
|
311
306
|
value = val[target]
|
|
312
|
-
raise "The translations are not synchronized for #{keys.
|
|
307
|
+
raise "The translations are not synchronized for \"#{target}\" at \"#{(keys + [key]).map(&:to_s).join '>'}\"" if value.nil?
|
|
313
308
|
value.stringify_keys! if value.is_a? Hash
|
|
314
309
|
h[key.to_s] = value
|
|
315
310
|
end
|