DEV: Add rubocop and Transifex integration

DEV: Add rubocop and Transifex integration

diff --git a/.rubocop.yml b/.rubocop.yml
new file mode 100644
index 0000000..d46296c
--- /dev/null
+++ b/.rubocop.yml
@@ -0,0 +1,2 @@
+inherit_gem:
+  rubocop-discourse: default.yml
diff --git a/.tx/config b/.tx/config
new file mode 100644
index 0000000..fe96f3b
--- /dev/null
+++ b/.tx/config
@@ -0,0 +1,15 @@
+[main]
+host = https://www.transifex.com
+lang_map = el_GR: el, es_ES: es, fr_FR: fr, hu_HU: hu, ko_KR: ko, pt_PT: pt, sk_SK: sk, vi_VN: vi
+
+[discourse-org.pluginencryptclientyml]
+file_filter = config/locales/client.<lang>.yml
+source_file = config/locales/client.en.yml
+source_lang = en
+type = YML
+
+[discourse-org.pluginencryptserveryml]
+file_filter = config/locales/server.<lang>.yml
+source_file = config/locales/server.en.yml
+source_lang = en
+type = YML
diff --git a/Gemfile b/Gemfile
new file mode 100644
index 0000000..f6bd3b2
--- /dev/null
+++ b/Gemfile
@@ -0,0 +1,6 @@
+# frozen_string_literal: true
+
+group :development do
+  gem 'translations-manager', git: 'https://github.com/discourse/translations-manager.git'
+  gem 'rubocop-discourse'
+end
diff --git a/Gemfile.lock b/Gemfile.lock
new file mode 100644
index 0000000..1efbc55
--- /dev/null
+++ b/Gemfile.lock
@@ -0,0 +1,43 @@
+GIT
+  remote: https://github.com/discourse/translations-manager.git
+  revision: d6da5ff928b9ea39a15c9b6f16b856f46bc9069b
+  specs:
+    translations-manager (0.6)
+
+GEM
+  specs:
+    ast (2.4.0)
+    parallel (1.19.1)
+    parser (2.7.1.3)
+      ast (~> 2.4.0)
+    rainbow (3.0.0)
+    regexp_parser (1.7.1)
+    rexml (3.2.4)
+    rubocop (0.85.1)
+      parallel (~> 1.10)
+      parser (>= 2.7.0.1)
+      rainbow (>= 2.2.2, < 4.0)
+      regexp_parser (>= 1.7)
+      rexml
+      rubocop-ast (>= 0.0.3)
+      ruby-progressbar (~> 1.7)
+      unicode-display_width (>= 1.4.0, < 2.0)
+    rubocop-ast (0.0.3)
+      parser (>= 2.7.0.1)
+    rubocop-discourse (2.1.2)
+      rubocop (>= 0.69.0)
+      rubocop-rspec (>= 1.39.0)
+    rubocop-rspec (1.39.0)
+      rubocop (>= 0.68.1)
+    ruby-progressbar (1.10.1)
+    unicode-display_width (1.7.0)
+
+PLATFORMS
+  ruby
+
+DEPENDENCIES
+  rubocop-discourse
+  translations-manager!
+
+BUNDLED WITH
+   2.1.4
diff --git a/bin/pull_translations.rb b/bin/pull_translations.rb
new file mode 100755
index 0000000..789ccaa
--- /dev/null
+++ b/bin/pull_translations.rb
@@ -0,0 +1,16 @@
+#!/usr/bin/env ruby
+# frozen_string_literal: true
+
+# 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

GitHub sha: a1547263

1 Like

can you please sync transifex so that the next release contains the lattest / greatest translations?