farend / redmine_message_customize

This is a plugin for Redmine.
GNU General Public License v2.0
29 stars 11 forks source link

Select the current user's language by default in select#lang drop-down #27

Closed vividtone closed 5 years ago

vividtone commented 5 years ago

Currently, the default value for select#lang drop-down is always "en". I think it should be User.current.language or Setting.default_language because users want to customize messages of their own language in many cases.

image

ishikawa999 commented 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.

vividtone commented 5 years ago

I found the condition that the problem occurs:

I think using the current locale works better than using @setting.custom_messages.keys.first.

ishikawa999 commented 5 years ago

Merged changes.