immosquare-yaml 0.1.5 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/immosquare-yaml/version.rb +1 -1
- data/lib/tasks/immosquare-yaml.rake +4 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0dac9c00ae705f9f467cd18ccb917484caf63a422e06ef344846dafdc52d1f5a
|
4
|
+
data.tar.gz: 5bde31fc5ab408e67f619e53762fb5da22f85fc61d49e9db56dcb3eb75115b77
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: edebdc23ec566c33ca1310086e9934290057ae007c0a3898e9d501d02253a5ff0832848e0b24e48755d9c3475399e18bee5ce7c0a36386cc0a79e389e026fc94
|
7
|
+
data.tar.gz: 18d233c88da27c163b285c08da55fd0306b49500e13199d0e0eda8d2c41a671659496e9c52681ed0c842a1d64f34ba3415b3671dbf2e1bf030024c5f69c71b94
|
@@ -9,14 +9,16 @@ namespace :immosquare_yaml do
|
|
9
9
|
begin
|
10
10
|
source_locale = ENV.fetch("SOURCE_LOCALE", nil) || "fr"
|
11
11
|
reset_translations = ENV.fetch("RESET_TRANSLATIONS", nil) || false
|
12
|
+
reset_translations = reset_translations == "true"
|
13
|
+
|
12
14
|
raise("Please provide a valid locale") if !I18n.available_locales.map(&:to_s).include?(source_locale)
|
13
15
|
raise("Please provide a valid boolean for reset_translations") if ![true, false].include?(reset_translations)
|
14
16
|
|
15
17
|
locales = I18n.available_locales.map(&:to_s).reject {|l| l == source_locale }
|
16
|
-
puts("Translating #{source_locale} to #{locales.join(", ")} with reset_translations=#{reset_translations}")
|
18
|
+
puts("Translating from #{source_locale} to #{locales.join(", ")} with reset_translations=#{reset_translations}")
|
17
19
|
Dir.glob("#{Rails.root}/config/locales/**/*#{source_locale}.yml").each do |file|
|
18
20
|
locales.each do |locale|
|
19
|
-
ImmosquareYaml::Translate.translate(file, locale, reset_translations)
|
21
|
+
ImmosquareYaml::Translate.translate(file, locale, :reset_translations => reset_translations)
|
20
22
|
end
|
21
23
|
end
|
22
24
|
rescue StandardError => e
|