1
0
Fork 0
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:
Mike Perham 2013-04-25 10:29:10 -07:00
parent 7751e6f996
commit 05835047e6

View file

@ -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