From 3112c168a76ee2cdf4032adcba6b800661680833 Mon Sep 17 00:00:00 2001 From: Alexander Semyonov Date: Thu, 4 Dec 2014 04:36:22 +0300 Subject: [PATCH 1/7] Add Russian translation --- config/locales/de.yml | 1 + config/locales/en.yml | 1 + config/locales/es.yml | 1 + config/locales/hu.yml | 1 + config/locales/it.yml | 1 + config/locales/pt-BR.yml | 1 + config/locales/pt-PT.yml | 1 + config/locales/ru.yml | 16 ++++++++++++++++ 8 files changed, 23 insertions(+) create mode 100644 config/locales/ru.yml diff --git a/config/locales/de.yml b/config/locales/de.yml index 386e40b0..e9a67bee 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -11,5 +11,6 @@ de: it: "Italienisch" pt-BR: "Portugiesisch" pt-PT: "Portugiesisch (Portugal)" + ru: "Russisch" tr: "Türkisch" diff --git a/config/locales/en.yml b/config/locales/en.yml index d8c4b741..c90977e5 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -11,5 +11,6 @@ en: it: "Italian" pt-BR: "Portuguese" pt-PT: "Portuguese (Portugal)" + ru: "Russian" tr: "Turkish" diff --git a/config/locales/es.yml b/config/locales/es.yml index 8045eafa..6fe23593 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -11,4 +11,5 @@ es: it: "Italiano" pt-BR: "Portugués" pt-PT: "Portugués (Portugal)" + ru: "Ruso" tr: "Turco" diff --git a/config/locales/hu.yml b/config/locales/hu.yml index 5440c653..53c0d586 100644 --- a/config/locales/hu.yml +++ b/config/locales/hu.yml @@ -11,5 +11,6 @@ hu: it: "Olasz" pt-BR: "Portuguese" pt-PT: "Portuguese (Portugal)" + ru: "Orosz" tr: "Török" diff --git a/config/locales/it.yml b/config/locales/it.yml index a3b1e08c..ed6b8b47 100644 --- a/config/locales/it.yml +++ b/config/locales/it.yml @@ -11,5 +11,6 @@ it: it: "Italiano" pt-BR: "Portoghese" pt-PT: "Portoghese (Portogallo)" + ru: "Russo" tr: "Turco" diff --git a/config/locales/pt-BR.yml b/config/locales/pt-BR.yml index f5292a03..971108d0 100644 --- a/config/locales/pt-BR.yml +++ b/config/locales/pt-BR.yml @@ -11,5 +11,6 @@ pt-BR: it: "Italiano" pt-BR: "Português" pt-PT: "Português (Portugal)" + ru: "Russo" tr: "Turco" diff --git a/config/locales/pt-PT.yml b/config/locales/pt-PT.yml index 6249ab44..03b6c15b 100644 --- a/config/locales/pt-PT.yml +++ b/config/locales/pt-PT.yml @@ -11,5 +11,6 @@ pt-PT: it: "Italiano" pt-BR: "Português" pt-PT: "Português (Portugal)" + ru: "Russo" tr: "Turco" diff --git a/config/locales/ru.yml b/config/locales/ru.yml new file mode 100644 index 00000000..87280fbf --- /dev/null +++ b/config/locales/ru.yml @@ -0,0 +1,16 @@ +ru: + active_admin: + globalize: + translations: "Переводы" + language: + de: "Немецкий" + en: "Английский" + es: "Испанский" + fr: "Французский" + hu: "Венгенрский" + it: "Итальянский" + pt-BR: "Португальский (Бразилия)" + pt-PT: "Португальский (Португалия)" + ru: "Русский" + tr: "Турецкий" + From d034540cc697bde853f5d20967deecac49edc812 Mon Sep 17 00:00:00 2001 From: Alexander Semyonov Date: Thu, 4 Dec 2014 16:39:35 +0300 Subject: [PATCH 2/7] Remove deprecated form_buffers --- lib/active_admin/globalize/form_builder_extension.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/active_admin/globalize/form_builder_extension.rb b/lib/active_admin/globalize/form_builder_extension.rb index cc62d73b..ebf70fa0 100644 --- a/lib/active_admin/globalize/form_builder_extension.rb +++ b/lib/active_admin/globalize/form_builder_extension.rb @@ -7,7 +7,7 @@ def translated_inputs(name = "Translations", options = {}, &block) options.symbolize_keys! switch_locale = options.fetch(:switch_locale, false) auto_sort = options.fetch(:auto_sort, true) - form_buffers.last << template.content_tag(:div, class: "activeadmin-translations") do + template.content_tag(:div, class: "activeadmin-translations") do template.content_tag(:ul, class: "available-locales") do (auto_sort ? I18n.available_locales.sort : I18n.available_locales).map do |locale| template.content_tag(:li) do From 7bc9697b85809e2bcd32df88346ba961ac1d42ba Mon Sep 17 00:00:00 2001 From: Alexander Semyonov Date: Tue, 9 Dec 2014 01:46:48 +0300 Subject: [PATCH 3/7] Do not add id input for new translations --- lib/active_admin/globalize/form_builder_extension.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/active_admin/globalize/form_builder_extension.rb b/lib/active_admin/globalize/form_builder_extension.rb index ebf70fa0..423d5804 100644 --- a/lib/active_admin/globalize/form_builder_extension.rb +++ b/lib/active_admin/globalize/form_builder_extension.rb @@ -22,13 +22,13 @@ def translated_inputs(name = "Translations", options = {}, &block) translation ||= object.translations.build(locale: locale) fields = proc do |form| form.input(:locale, as: :hidden) - form.input(:id, as: :hidden) + form.input(:id, as: :hidden) if translation.persisted? I18n.with_locale(switch_locale ? locale : I18n.locale) do block.call(form) end end inputs_for_nested_attributes( - for: [:translations, translation ], + for: [:translations, translation], class: "inputs locale locale-#{translation.locale}", &fields ) From 5971b54f9bf4f564987114b4ca6db9ec0663a743 Mon Sep 17 00:00:00 2001 From: Alexander Semyonov Date: Tue, 9 Dec 2014 01:47:08 +0300 Subject: [PATCH 4/7] Point Gemfile to right ActiveAdmin repo --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 37614d72..6dc795e2 100644 --- a/Gemfile +++ b/Gemfile @@ -2,5 +2,5 @@ source "https://rubygems.org" gemspec -gem 'activeadmin', github: 'gregbell/active_admin', branch: 'master' +gem 'activeadmin', github: 'activeadmin', branch: 'master' From c26485ee07dde0fc99ad73e0ad392294191a282f Mon Sep 17 00:00:00 2001 From: Alex Semyonov Date: Sat, 28 Nov 2015 05:25:45 +0300 Subject: [PATCH 5/7] Precompile assets in all groups --- lib/active_admin/globalize/engine.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/active_admin/globalize/engine.rb b/lib/active_admin/globalize/engine.rb index b0cc2a65..8dd58f6b 100644 --- a/lib/active_admin/globalize/engine.rb +++ b/lib/active_admin/globalize/engine.rb @@ -1,7 +1,7 @@ module ActiveAdmin module Globalize class Engine < ::Rails::Engine - initializer "Active Admin precompile hook", group: :assets do |app| + initializer "Active Admin precompile hook", group: :all do |app| app.config.assets.precompile += [ "active_admin/active_admin_globalize.css", "active_admin/active_admin_globalize.js" From bb6f5923a6c8fd4765a55fa829799ea112501a82 Mon Sep 17 00:00:00 2001 From: Alex Semyonov Date: Sat, 28 Nov 2015 05:26:56 +0300 Subject: [PATCH 6/7] Ignore Gemfile.lock (activeadmin-globalize is a gem!) --- .gitignore | 2 +- Gemfile | 2 +- Gemfile.lock | 162 --------------------------------------------------- 3 files changed, 2 insertions(+), 164 deletions(-) delete mode 100644 Gemfile.lock diff --git a/.gitignore b/.gitignore index 438fd0c3..5fdf5279 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ .bundle/ .bin - +Gemfile.lock diff --git a/Gemfile b/Gemfile index 6dc795e2..7b6d93e3 100644 --- a/Gemfile +++ b/Gemfile @@ -1,4 +1,4 @@ -source "https://rubygems.org" +source 'https://rubygems.org' gemspec diff --git a/Gemfile.lock b/Gemfile.lock deleted file mode 100644 index 825eed41..00000000 --- a/Gemfile.lock +++ /dev/null @@ -1,162 +0,0 @@ -GIT - remote: git://github.com/gregbell/active_admin.git - revision: f21cff30e7212706a39710e2c70ad0af8087ccea - branch: master - specs: - activeadmin (1.0.0.pre) - arbre (~> 1.0) - bourbon - coffee-rails - devise (~> 3.2) - formtastic (~> 2.3.0.rc2) - inherited_resources (~> 1.3) - jquery-rails - jquery-ui-rails - kaminari (~> 0.15) - rails (>= 3.2, < 4.1) - ransack (~> 1.0) - sass-rails - -PATH - remote: . - specs: - activeadmin-globalize (1.0.0) - activeadmin - globalize (~> 4.0.0) - -GEM - remote: https://rubygems.org/ - specs: - actionmailer (4.0.2) - actionpack (= 4.0.2) - mail (~> 2.5.4) - actionpack (4.0.2) - activesupport (= 4.0.2) - builder (~> 3.1.0) - erubis (~> 2.7.0) - rack (~> 1.5.2) - rack-test (~> 0.6.2) - activemodel (4.0.2) - activesupport (= 4.0.2) - builder (~> 3.1.0) - activerecord (4.0.2) - activemodel (= 4.0.2) - activerecord-deprecated_finders (~> 1.0.2) - activesupport (= 4.0.2) - arel (~> 4.0.0) - activerecord-deprecated_finders (1.0.3) - activesupport (4.0.2) - i18n (~> 0.6, >= 0.6.4) - minitest (~> 4.2) - multi_json (~> 1.3) - thread_safe (~> 0.1) - tzinfo (~> 0.3.37) - arbre (1.0.1) - activesupport (>= 3.0.0) - arel (4.0.1) - atomic (1.1.14) - bcrypt-ruby (3.1.2) - bourbon (3.1.8) - sass (>= 3.2.0) - thor - builder (3.1.4) - coffee-rails (4.0.1) - coffee-script (>= 2.2.0) - railties (>= 4.0.0, < 5.0) - coffee-script (2.2.0) - coffee-script-source - execjs - coffee-script-source (1.6.3) - devise (3.2.2) - bcrypt-ruby (~> 3.0) - orm_adapter (~> 0.1) - railties (>= 3.2.6, < 5) - thread_safe (~> 0.1) - warden (~> 1.2.3) - erubis (2.7.0) - execjs (2.0.2) - formtastic (2.3.0.rc2) - actionpack (>= 3.0) - globalize (4.0.0) - activemodel (>= 4.0.0, < 5) - activerecord (>= 4.0.0, < 5) - has_scope (0.6.0.rc) - actionpack (>= 3.2, < 5) - activesupport (>= 3.2, < 5) - hike (1.2.3) - i18n (0.6.9) - inherited_resources (1.4.1) - has_scope (~> 0.6.0.rc) - responders (~> 1.0.0.rc) - jquery-rails (3.0.4) - railties (>= 3.0, < 5.0) - thor (>= 0.14, < 2.0) - jquery-ui-rails (4.1.1) - railties (>= 3.1.0) - kaminari (0.15.1) - actionpack (>= 3.0.0) - activesupport (>= 3.0.0) - mail (2.5.4) - mime-types (~> 1.16) - treetop (~> 1.4.8) - mime-types (1.25.1) - minitest (4.7.5) - multi_json (1.8.4) - orm_adapter (0.5.0) - polyamorous (0.6.4) - activerecord (>= 3.0) - polyglot (0.3.3) - rack (1.5.2) - rack-test (0.6.2) - rack (>= 1.0) - rails (4.0.2) - actionmailer (= 4.0.2) - actionpack (= 4.0.2) - activerecord (= 4.0.2) - activesupport (= 4.0.2) - bundler (>= 1.3.0, < 2.0) - railties (= 4.0.2) - sprockets-rails (~> 2.0.0) - railties (4.0.2) - actionpack (= 4.0.2) - activesupport (= 4.0.2) - rake (>= 0.8.7) - thor (>= 0.18.1, < 2.0) - rake (10.1.1) - ransack (1.1.0) - actionpack (>= 3.0) - activerecord (>= 3.0) - polyamorous (~> 0.6.0) - responders (1.0.0) - railties (>= 3.2, < 5) - sass (3.2.13) - sass-rails (4.0.1) - railties (>= 4.0.0, < 5.0) - sass (>= 3.1.10) - sprockets-rails (~> 2.0.0) - sprockets (2.10.1) - hike (~> 1.2) - multi_json (~> 1.0) - rack (~> 1.0) - tilt (~> 1.1, != 1.3.0) - sprockets-rails (2.0.1) - actionpack (>= 3.0) - activesupport (>= 3.0) - sprockets (~> 2.8) - thor (0.18.1) - thread_safe (0.1.3) - atomic - tilt (1.4.1) - treetop (1.4.15) - polyglot - polyglot (>= 0.3.1) - tzinfo (0.3.38) - warden (1.2.3) - rack (>= 1.0) - -PLATFORMS - ruby - -DEPENDENCIES - activeadmin! - activeadmin-globalize! From de3c946fe7380afd7c758e0dcdf7f7fbb675c6b7 Mon Sep 17 00:00:00 2001 From: Alex Semyonov Date: Thu, 24 Dec 2015 04:08:04 +0300 Subject: [PATCH 7/7] Depend on stable globalize --- activeadmin-globalize.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/activeadmin-globalize.gemspec b/activeadmin-globalize.gemspec index 27c698d8..7f1bcaab 100644 --- a/activeadmin-globalize.gemspec +++ b/activeadmin-globalize.gemspec @@ -16,6 +16,6 @@ Gem::Specification.new do |s| s.files = Dir["{app,config,db,lib}/**/*"] + ["MIT-LICENSE", "README.md"] s.add_dependency "activeadmin" - s.add_dependency "globalize", '~> 4.0.0' + s.add_dependency "globalize", '~> 5.0.1' end