Merge pull request #4647 from consul/rtl
Improve support for RTL languages
This commit is contained in:
3
app/assets/stylesheets/application-rtl.scss
Normal file
3
app/assets/stylesheets/application-rtl.scss
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
$global-text-direction: rtl;
|
||||||
|
|
||||||
|
@import "application";
|
||||||
@@ -6,6 +6,10 @@ module ApplicationHelper
|
|||||||
url_for(request.query_parameters.merge(query_parameters).merge(only_path: true))
|
url_for(request.query_parameters.merge(query_parameters).merge(only_path: true))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def rtl?
|
||||||
|
%i[ar fa he].include?(I18n.locale)
|
||||||
|
end
|
||||||
|
|
||||||
def markdown(text)
|
def markdown(text)
|
||||||
return text if text.blank?
|
return text if text.blank?
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,11 @@
|
|||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||||
<title><%= content_for?(:title) ? yield(:title) : default_title %></title>
|
<title><%= content_for?(:title) ? yield(:title) : default_title %></title>
|
||||||
<%= stylesheet_link_tag "application" %>
|
<% if rtl? %>
|
||||||
|
<%= stylesheet_link_tag "application-rtl" %>
|
||||||
|
<% else %>
|
||||||
|
<%= stylesheet_link_tag "application" %>
|
||||||
|
<% end %>
|
||||||
<%= javascript_include_tag "application", "data-turbolinks-track" => "reload" %>
|
<%= javascript_include_tag "application", "data-turbolinks-track" => "reload" %>
|
||||||
<%= csrf_meta_tags %>
|
<%= csrf_meta_tags %>
|
||||||
<%= favicon_link_tag "favicon.ico" %>
|
<%= favicon_link_tag "favicon.ico" %>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="<%= I18n.locale %>">
|
<html <%= "dir=rtl" if rtl? %> lang="<%= I18n.locale %>">
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<%= render "layouts/common_head", default_title: "Admin" %>
|
<%= render "layouts/common_head", default_title: "Admin" %>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="<%= I18n.locale %>" data-current-user-id="<%= current_user&.id %>">
|
<html <%= "dir=rtl" if rtl? %> lang="<%= I18n.locale %>" data-current-user-id="<%= current_user&.id %>">
|
||||||
<head>
|
<head>
|
||||||
<%= render "layouts/common_head", default_title: setting["org_name"] %>
|
<%= render "layouts/common_head", default_title: setting["org_name"] %>
|
||||||
<%= render "layouts/tracking_data" %>
|
<%= render "layouts/tracking_data" %>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="<%= I18n.locale %>">
|
<html <%= "dir=rtl" if rtl? %> lang="<%= I18n.locale %>">
|
||||||
<head>
|
<head>
|
||||||
<%= render "layouts/common_head", default_title: setting["org_name"] %>
|
<%= render "layouts/common_head", default_title: setting["org_name"] %>
|
||||||
<%= render "layouts/meta_tags" %>
|
<%= render "layouts/meta_tags" %>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="<%= I18n.locale %>">
|
<html <%= "dir=rtl" if rtl? %> lang="<%= I18n.locale %>">
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<%= render "layouts/common_head", default_title: "Management" %>
|
<%= render "layouts/common_head", default_title: "Management" %>
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ Rails.application.config.assets.version = "1.0"
|
|||||||
Rails.application.config.assets.precompile += %w[ckeditor/config.js]
|
Rails.application.config.assets.precompile += %w[ckeditor/config.js]
|
||||||
Rails.application.config.assets.precompile += %w[stat_graphs.js]
|
Rails.application.config.assets.precompile += %w[stat_graphs.js]
|
||||||
Rails.application.config.assets.precompile += %w[dashboard_graphs.js]
|
Rails.application.config.assets.precompile += %w[dashboard_graphs.js]
|
||||||
|
Rails.application.config.assets.precompile += %w[application-rtl.css]
|
||||||
Rails.application.config.assets.precompile += %w[print.css]
|
Rails.application.config.assets.precompile += %w[print.css]
|
||||||
Rails.application.config.assets.precompile += %w[pdf_fonts.css]
|
Rails.application.config.assets.precompile += %w[pdf_fonts.css]
|
||||||
Rails.application.config.assets.precompile += %w[sdg/*.png]
|
Rails.application.config.assets.precompile += %w[sdg/*.png]
|
||||||
|
|||||||
Reference in New Issue
Block a user