mirror of
https://github.com/meineerde/redmine.git
synced 2026-02-01 03:57:15 +00:00
CSV importer raises I18n::InvalidLocale exception if current user's language is "(auto)" (#905, #20535).
git-svn-id: http://svn.redmine.org/redmine/trunk@14504 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
f820ccce3b
commit
5fffbdc016
@ -60,7 +60,7 @@ module Redmine
|
||||
|
||||
# Localizes the given args with user's language
|
||||
def lu(user, *args)
|
||||
lang = user.try(:language) || Setting.default_language
|
||||
lang = user.try(:language).presence || Setting.default_language
|
||||
ll(lang, *args)
|
||||
end
|
||||
|
||||
|
||||
@ -162,6 +162,15 @@ class Redmine::I18nTest < ActiveSupport::TestCase
|
||||
assert_equal "-1000,20 #{euro_sign}", number_to_currency(-1000.2)
|
||||
end
|
||||
|
||||
def test_lu_should_not_error_when_user_language_is_an_empty_string
|
||||
user = User.new
|
||||
user.language = ''
|
||||
|
||||
assert_nothing_raised do
|
||||
lu(user, :label_issue)
|
||||
end
|
||||
end
|
||||
|
||||
def test_valid_languages
|
||||
assert valid_languages.is_a?(Array)
|
||||
assert valid_languages.first.is_a?(Symbol)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user