berti92 / mega_calendar

Plugin for redmine: Brings a better calendar and more opportunities to display issues and holidays
http://www.devbert.de/index.php/en/project/megacalendar/
MIT License
70 stars 52 forks source link

Get user language, from a Redmine settings #63

Closed YouSysAdmin closed 7 years ago

YouSysAdmin commented 7 years ago
request.env['HTTP_ACCEPT_LANGUAGE']

Not effective method, used detect user language.

Sample: OS: CentOS7 Browser: Firefox System/Browser lang: Russian

HTTP_ACCEPT_LANGUAGE = en-US :)

The user language is stored in two parameters:

  1. User.current.language - from profile settings
  2. Setting.default_language - from default redmine settings
berti92 commented 7 years ago

Thank you for your work!