A platform for community discussion. Free, open, simple.
DEV: Remove duplicate definition of RTL locales and add Uyghur to the list (#27387)
Gerhard Schlager1fbc1cd32678
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rbindex b409efe2183..e0a0d22a1ef 100644--- a/app/helpers/application_helper.rb+++ b/app/helpers/application_helper.rb@@ -259,7 +259,7 @@ module ApplicationHelperenddef rtl?- %w[ar ur fa_IR he].include? I18n.locale.to_s+ Rtl::LOCALES.include? I18n.locale.to_senddef html_langdiff --git a/lib/rtl.rb b/lib/rtl.rbindex 80259f06d17..c58a57a75fc 100644--- a/lib/rtl.rb+++ b/lib/rtl.rb@@ -1,6 +1,8 @@# frozen_string_literal: trueclass Rtl+ LOCALES = %w[ar fa_IR he ug ur]+attr_reader :userdef initialize(user)@@ -12,15 +14,11 @@ class Rtlenddef current_user_rtl?- SiteSetting.allow_user_locale && (user&.locale || SiteSetting.default_locale).in?(rtl_locales)+ SiteSetting.allow_user_locale && (user&.locale || SiteSetting.default_locale).in?(LOCALES)enddef site_locale_rtl?- !SiteSetting.allow_user_locale && SiteSetting.default_locale.in?(rtl_locales)- end-- def rtl_locales- %w[he ar ur fa_IR]+ !SiteSetting.allow_user_locale && SiteSetting.default_locale.in?(LOCALES)enddef css_class