add pull_translations.rb

This commit is contained in:
Neil Lalonde 2017-11-15 11:16:23 -05:00
parent 6cc836e7c3
commit a0e743d023
4 changed files with 47 additions and 0 deletions

9
.tx/config Normal file
View File

@ -0,0 +1,9 @@
[main]
host = https://www.transifex.com
lang_map = el_GR: el, es_ES: es, fr_FR: fr, ko_KR: ko, pt_PT: pt, sk_SK: sk, vi_VN: vi
[discourse-org.docker_managerclientenyml]
file_filter = config/locales/client.<lang>.yml
source_file = config/locales/client.en.yml
source_lang = en
type = YML

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

18
Gemfile.lock Normal file
View File

@ -0,0 +1,18 @@
GIT
remote: https://github.com/discourse/translations-manager.git
revision: 91404d4206b3bbe9670aed25ecb31516f91659de
specs:
translations-manager (0.1.0)
GEM
remote: https://rubygems.org/
specs:
PLATFORMS
ruby
DEPENDENCIES
translations-manager!
BUNDLED WITH
1.13.6

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 = ['client']
TranslationsManager::TransifexUpdater.new(YML_DIRS, YML_FILE_PREFIXES, *ARGV).perform