summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorelijah <elijah@riseup.net>2015-06-15 17:12:05 -0700
committerelijah <elijah@riseup.net>2015-06-15 17:12:05 -0700
commit12ab515ecd448f98ff006e30a93e43626183b6d0 (patch)
tree86023afaee3851029991ef684a88f893384d2c26 /lib
parent9d1c6d33645196df697f2733860d23f0bb39b1c4 (diff)
imported new locales from transifex
Diffstat (limited to 'lib')
-rw-r--r--lib/tasks/i18n.rake19
1 files changed, 13 insertions, 6 deletions
diff --git a/lib/tasks/i18n.rake b/lib/tasks/i18n.rake
index 5ccc65e..2392d8a 100644
--- a/lib/tasks/i18n.rake
+++ b/lib/tasks/i18n.rake
@@ -47,14 +47,21 @@ namespace :i18n do
end
end
-
- # elijah: this does not actually work, but I think could be a starting point
- # for something that will work.
desc "pull translations from transifex"
task :download do
- Conf.enabled_languages.each do |lang|
- next unless lang == 'en'
- `curl -L --user #{Conf.transifex_user}:#{Conf.transifex_password} -X GET https://www.transifex.net/api/2/project/crabgrass/resource/master/translation/#{lang}/?file > config/locales/#{lang}.yml`
+ Dir.chdir('config/') do
+ if !File.exists?('transifex.netrc')
+ puts "In order to download translations, you need a config/transifex.netrc file."
+ puts "For example:"
+ puts "machine www.transifex.com login yourusername password yourpassword"
+ exit
+ end
+ APP_CONFIG[:available_locales].each do |lang|
+ next if lang == :en
+ puts "downloading #{lang}"
+ `curl -L --netrc-file transifex.netrc -X GET 'https://www.transifex.com/api/2/project/bitmask/resource/leap_web/translation/#{lang}/?file' > locales/#{lang}.yml`
+ end
end
end
+
end