From b3dab52e10cbe96b8553905a1239caf36bab4f4a Mon Sep 17 00:00:00 2001 From: Ajit Mujumdar <38528640+imajit@users.noreply.github.com> Date: Tue, 22 Jun 2021 20:28:01 +0530 Subject: [PATCH] Reduced globe icon count (#9826) * Reduced globe icon count * Added equal sign Co-authored-by: imajit --- app/assets/javascripts/translation.js | 5 +++++ app/helpers/application_helper.rb | 4 ++-- app/views/dashboard/dashboard.html.erb | 1 + app/views/home/subscriptions.html.erb | 1 + app/views/users/profile.html.erb | 1 + config/initializers/assets.rb | 1 + 6 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 app/assets/javascripts/translation.js diff --git a/app/assets/javascripts/translation.js b/app/assets/javascripts/translation.js new file mode 100644 index 0000000000..fd47b47101 --- /dev/null +++ b/app/assets/javascripts/translation.js @@ -0,0 +1,5 @@ +$(document).ready(function () { + $('.translationIcon').filter(function(i) { + return (i + 1) % 3 === 0 + }).show(); +}); \ No newline at end of file diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 8ff1a1424a..e41dab7bb9 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -160,8 +160,8 @@ def translation(key, options = {}, html = true) translated_string2 = t(key, options) if html && current_user&.has_tag('translation-helper') && translated_string2.include?("translation missing") && !translated_string.include?("<") - raw(%(#{translated_string} - + raw(%(#{translated_string} )) else raw(translated_string) diff --git a/app/views/dashboard/dashboard.html.erb b/app/views/dashboard/dashboard.html.erb index 41e24d72f6..8b4173b241 100644 --- a/app/views/dashboard/dashboard.html.erb +++ b/app/views/dashboard/dashboard.html.erb @@ -78,3 +78,4 @@ <%= stylesheet_link_tag "dashboard" %> <%= javascript_include_tag "dashboard" %> +<%= javascript_include_tag "translation" %> diff --git a/app/views/home/subscriptions.html.erb b/app/views/home/subscriptions.html.erb index ef15efd0ac..cfdcd10b9a 100644 --- a/app/views/home/subscriptions.html.erb +++ b/app/views/home/subscriptions.html.erb @@ -8,6 +8,7 @@ } }); +<%= javascript_include_tag "translation" %>
diff --git a/app/views/users/profile.html.erb b/app/views/users/profile.html.erb index a05b9509cd..80fcd18be3 100644 --- a/app/views/users/profile.html.erb +++ b/app/views/users/profile.html.erb @@ -274,6 +274,7 @@
+<%= javascript_include_tag "translation" %> diff --git a/config/initializers/assets.rb b/config/initializers/assets.rb index 05c4610326..3f72465238 100644 --- a/config/initializers/assets.rb +++ b/config/initializers/assets.rb @@ -15,6 +15,7 @@ 'question.js', 'sidebar.js', 'textBoxExpand.js', + 'translation.js', 'blog.css', 'comments.css',