about summary refs log tree commit diff
path: root/app/helpers
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2018-01-29 00:22:20 +0100
committerGitHub <noreply@github.com>2018-01-29 00:22:20 +0100
commit79bc3d58456a850a7f2d99a2c0e15ff1618c1a0e (patch)
tree5bec2a3bf54ff6e840884771b2e8a49db11d6380 /app/helpers
parent106efba800a63d508aabdc661cb0551c2b82110c (diff)
Add direction tags to HTML e-mails for RTL languages (#6373)
Diffstat (limited to 'app/helpers')
-rw-r--r--app/helpers/application_helper.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 8ed5c8bda..bab4615a1 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -22,10 +22,18 @@ module ApplicationHelper
   end
 
   def add_rtl_body_class(other_classes)
-    other_classes = "#{other_classes} rtl" if [:ar, :fa, :he].include?(I18n.locale)
+    other_classes = "#{other_classes} rtl" if locale_direction == 'rtl'
     other_classes
   end
 
+  def locale_direction
+    if [:ar, :fa, :he].include?(I18n.locale)
+      'rtl'
+    else
+      'ltr'
+    end
+  end
+
   def favicon_path
     env_suffix = Rails.env.production? ? '' : '-dev'
     "/favicon#{env_suffix}.ico"