Skip to content

Commit

Permalink
add pull_translations.rb
Browse files Browse the repository at this point in the history
  • Loading branch information
nlalonde committed Nov 15, 2017
1 parent 6cc836e commit a0e743d
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .tx/config
Original file line number Diff line number Diff line change
@@ -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 changes: 5 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
source 'https://rubygems.org'

group :development do
gem 'translations-manager', git: 'https://github.com/discourse/translations-manager.git'
end
18 changes: 18 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -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 changes: 15 additions & 0 deletions bin/pull_translations.rb
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit a0e743d

Please sign in to comment.