Check site default locale if Rtl class is initialized without a user (#8417)

This commit is contained in:
Simon Cossar 2019-11-26 15:01:37 -05:00 committed by GitHub
parent ff34ab6aef
commit 935d4cfa60
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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?