translations_sync 0.4.8 → 0.4.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Changelog +3 -0
- data/lib/translations_sync.rb +5 -4
- 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: dbb0d0663a40994cbad4f5f7494e154b898babba
|
4
|
+
data.tar.gz: d828042f45fe95a33eda19f1c58fd165fc2b354a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 07ae25ca3eb3fe5463aa7b8fecf10a2ab1a21fd7968788c51e2f46afd6c5fa2dfba5af4ffe9bda2b97422e2ce5559682a786ea5d56801b60f15e2b357f3cefbe
|
7
|
+
data.tar.gz: 89ab19114a4ba1e743e99eb324e84c94a42ead640dcfeb267e3866d6da5305d9f45e09b724a829995b7bf163c04c528dce9666c64e49e6b4160886ec13515e9a
|
data/Changelog
CHANGED
data/lib/translations_sync.rb
CHANGED
@@ -89,14 +89,14 @@ class TranslationsSync
|
|
89
89
|
acc
|
90
90
|
end
|
91
91
|
|
92
|
-
translations_path_re = Regexp.new "#{translations_dir}(\\/[a-z]{2}(?:-[A-Z]{2})?)?\\/[-_/0-9a-zA-Z]+(?:(_|.)[a-z]{2}(?:-[A-Z]{2})?)
|
92
|
+
translations_path_re = Regexp.new "#{translations_dir}(\\/[a-z]{2}(?:-[A-Z]{2})?)?\\/[-_/0-9a-zA-Z]+(?:(_|.)[a-z]{2}(?:-[A-Z]{2})?)\\.(?:yml|rb)\\Z"
|
93
93
|
I18n.load_path.find do |path|
|
94
94
|
path.match translations_path_re
|
95
95
|
end
|
96
96
|
@prefix = $1 or @separator = $2
|
97
97
|
|
98
98
|
if source
|
99
|
-
translations_path_re = Regexp.new "#{translations_dir}(\\/[a-z]{2}(?:-[A-Z]{2})?)?\\/#{Regexp.escape source}(?:(_|.)[a-z]{2}(?:-[A-Z]{2})?)
|
99
|
+
translations_path_re = Regexp.new "#{translations_dir}(\\/[a-z]{2}(?:-[A-Z]{2})?)?\\/#{Regexp.escape source}(?:(_|.)[a-z]{2}(?:-[A-Z]{2})?)\\.(?:yml|rb)\\Z"
|
100
100
|
I18n.load_path.reject! do |path|
|
101
101
|
path !~ translations_path_re
|
102
102
|
end
|
@@ -128,8 +128,9 @@ class TranslationsSync
|
|
128
128
|
size = list.size
|
129
129
|
@locales_with_missing = []
|
130
130
|
flat.each_pair do |key, val|
|
131
|
-
|
132
|
-
|
131
|
+
v = val.reject{|k, v| v.nil?}
|
132
|
+
if v.size < size
|
133
|
+
(@locales_with_missing += list - v.keys).uniq!
|
133
134
|
break if @locales_with_missing.size == size
|
134
135
|
end
|
135
136
|
end
|