Skip to content
Snippets Groups Projects
Unverified Commit 79bc3d58 authored by Eugen Rochko's avatar Eugen Rochko Committed by GitHub
Browse files

Add direction tags to HTML e-mails for RTL languages (#6373)

parent 106efba8
No related branches found
No related tags found
No related merge requests found
......@@ -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"
......
......@@ -3,6 +3,7 @@
class ApplicationMailer < ActionMailer::Base
layout 'mailer'
helper :application
helper :instance
helper :mailer
......
......@@ -3,6 +3,7 @@
class UserMailer < Devise::Mailer
layout 'mailer'
helper :application
helper :instance
add_template_helper RoutingHelper
......
......@@ -7,7 +7,7 @@
%title/
= stylesheet_pack_tag 'mailer'
%body
%body{ dir: locale_direction }
%table.email-table{ cellspacing: 0, cellpadding: 0 }
%tbody
%tr
......
- i ||= 0
%table.email-table{ cellspacing: 0, cellpadding: 0 }
%table.email-table{ cellspacing: 0, cellpadding: 0, dir: 'ltr' }
%tbody
%tr
%td.email-body
......@@ -24,7 +24,8 @@
%bdi= display_name(status.account)
= "@#{status.account.acct}"
= Formatter.instance.format(status)
%div{ dir: rtl_status?(status) ? 'rtl' : 'ltr' }
= Formatter.instance.format(status)
%p.status-footer
= link_to l(status.created_at), web_url("statuses/#{status.id}")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment