add pull_translations.rb

This commit is contained in:
Neil Lalonde 2017-11-15 11:07:33 -05:00
parent 4d3796d924
commit 78e86fb4fa
2 changed files with 20 additions and 0 deletions

5
Gemfile Normal file
View File

@ -0,0 +1,5 @@
source 'https://rubygems.org'
group :development do
gem 'translations-manager', git: 'https://github.com/discourse/translations-manager.git'
end

15
bin/pull_translations.rb Executable file
View File

@ -0,0 +1,15 @@
#!/usr/bin/env ruby
# Usage:
# bundle install
# bundle exec bin/pull_translations.rb
#
# To choose which languages to update, list them as arguments:
# bundle exec bin/pull_translations.rb he uk
require 'translations_manager'
YML_DIRS = ['config/locales'].map { |d| File.expand_path(d) }
YML_FILE_PREFIXES = ['server', 'client']
TranslationsManager::TransifexUpdater.new(YML_DIRS, YML_FILE_PREFIXES, *ARGV).perform