about summary refs log tree commit diff
path: root/app/helpers
diff options
context:
space:
mode:
authorDavid Yip <yipdw@member.fsf.org>2018-01-28 22:45:17 -0600
committerDavid Yip <yipdw@member.fsf.org>2018-01-28 22:45:17 -0600
commitf4b2478af11bd5e2125eb245bda4fda7577817d1 (patch)
tree6a09934546f4e2ad8db8d43372ac3192834a42f1 /app/helpers
parent00ce2be148a06ddd7e692ce963dfab356e331629 (diff)
parente14c20582f9f455ade989307016e6726cb8ff959 (diff)
Merge remote-tracking branch 'origin/master' into merge-upstream
 Conflicts:
	app/views/layouts/mailer.html.haml
	config/locales/ko.yml
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"