mirror of
https://github.com/mperham/sidekiq.git
synced 2022-11-09 13:52:34 -05:00
Rejigger i18n to return key itself if translation not found, #875
This commit is contained in:
parent
7751e6f996
commit
05835047e6
1 changed files with 2 additions and 2 deletions
|
@ -24,11 +24,11 @@ module Sidekiq
|
|||
end
|
||||
|
||||
def get_locale
|
||||
(request.env["HTTP_ACCEPT_LANGUAGE"] || 'en')[0,2]
|
||||
strings[(request.env["HTTP_ACCEPT_LANGUAGE"] || 'en')[0,2]] || strings['en']
|
||||
end
|
||||
|
||||
def t(msg, options={})
|
||||
string = strings[get_locale] ? strings[get_locale].fetch(msg) : strings['en'].fetch(msg)
|
||||
string = get_locale[msg] || msg
|
||||
string % options
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue