DEV: Add translations support

This commit is contained in:
Justin DiRose 2020-07-03 11:17:13 -05:00
parent 88f36c18a6
commit 8c670328b7
No known key found for this signature in database
GPG Key ID: 4B811FB264021800
3 changed files with 27 additions and 0 deletions

16
.tx/config Normal file
View File

@ -0,0 +1,16 @@
[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.pluginsubscriptionsclientyml]
file_filter = config/locales/client.<lang>.yml
source_file = config/locales/client.en.yml
source_lang = en
type = YML
[discourse-org.pluginsubscriptionsserveryml]
file_filter = config/locales/server.<lang>.yml
source_file = config/locales/server.en.yml
source_lang = en
type = YML

3
Gemfile Normal file
View File

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

8
bin/pull_translations.rb Normal file
View File

@ -0,0 +1,8 @@
#!/usr/bin/env ruby
require 'translations_manager'
YML_DIRS = ['config/locales'].map { |d| File.expand_path(d) }
YML_FILE_PREFIXES = ['client', 'server']
TranslationsManager::TransifexUpdater.new(YML_DIRS, YML_FILE_PREFIXES, *ARGV).perform