summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorelijah <elijah@riseup.net>2015-07-14 13:59:27 -0700
committerelijah <elijah@riseup.net>2015-07-14 13:59:27 -0700
commitb4f35ce6103d222e96d9153d5801044016329953 (patch)
tree9202452a7fc9286a9e45c782dbb05a15c85b77ee /lib
parentd2f1703e30319f7fc1f4c1a084d5b0363536d935 (diff)
a couple minor fixes for l10n
Diffstat (limited to 'lib')
-rw-r--r--lib/tasks/i18n.rake13
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/tasks/i18n.rake b/lib/tasks/i18n.rake
index b026fae..896f67e 100644
--- a/lib/tasks/i18n.rake
+++ b/lib/tasks/i18n.rake
@@ -47,6 +47,12 @@ namespace :i18n do
end
end
+ #
+ # I have not been able to get fallback from :pt => :'pt-BR' working.
+ # The rails guide implies that it does not work, even though I18n has
+ # a fallback mechanism.
+ # For now, just use a single language for ever locale.
+ #
LOCALE_ALIAS_MAP = {
:nb => 'nb-no',
:pt => 'pt-br'
@@ -65,8 +71,11 @@ namespace :i18n do
next if lang == :en
puts
puts "downloading #{lang}"
- lang_url = LOCALE_ALIAS_MAP[lang] || lang
- command = %[curl -L --netrc-file transifex.netrc -X GET 'https://www.transifex.com/api/2/project/bitmask/resource/leap_web/translation/#{lang_url}/?file' > locales/#{lang}.yml]
+ lang_url_segment = LOCALE_ALIAS_MAP[lang] || lang
+ url = "https://www.transifex.com/api/2/project/bitmask/resource/leap_web/translation/#{lang_url_segment}/?file"
+ command = %[echo "#{lang}:" > locales/#{lang}.yml && ]+
+ %[curl -L --netrc-file transifex.netrc -X GET '#{url}' ]+
+ %[| tail -n +2 >> locales/#{lang}.yml]
puts command
`#{command}`
end