From 935d4cfa603212c03fe9e670b2dfe2af46e52b33 Mon Sep 17 00:00:00 2001 From: Simon Cossar Date: Tue, 26 Nov 2019 15:01:37 -0500 Subject: [PATCH] Check site default locale if Rtl class is initialized without a user (#8417) --- lib/rtl.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rtl.rb b/lib/rtl.rb index 2df7acb4fc6..abf91ebf5c1 100644 --- a/lib/rtl.rb +++ b/lib/rtl.rb @@ -13,7 +13,7 @@ class Rtl end def current_user_rtl? - SiteSetting.allow_user_locale && user.try(:locale).in?(rtl_locales) + SiteSetting.allow_user_locale && (user&.locale || SiteSetting.default_locale).in?(rtl_locales) end def site_locale_rtl?