From 05835047e628f907704ea975cabe4bf8c410c1b6 Mon Sep 17 00:00:00 2001 From: Mike Perham Date: Thu, 25 Apr 2013 10:29:10 -0700 Subject: [PATCH] Rejigger i18n to return key itself if translation not found, #875 --- lib/sidekiq/web.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/sidekiq/web.rb b/lib/sidekiq/web.rb index 2ddce591..e1bb7109 100644 --- a/lib/sidekiq/web.rb +++ b/lib/sidekiq/web.rb @@ -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