Closed vividtone closed 5 years ago
How to select the current default language:
params[:lang].presence || User.current.language.presence || 'en'
I am going to change it as below
params[:lang].presence || @setting.custom_messages.keys.first || User.current.language.presence || Setting.default_language
@setting.custom_messages.keys.first
is one of the already customized languages.
I found the condition that the problem occurs:
I think using the current locale works better than using @setting.custom_messages.keys.first
.
Merged changes.
Currently, the default value for
select#lang
drop-down is always "en". I think it should beUser.current.language
orSetting.default_language
because users want to customize messages of their own language in many cases.