From a75b51bc9b4112d851a38f0e569565ce2c4602c6 Mon Sep 17 00:00:00 2001 From: Robert Date: Thu, 4 May 2017 14:36:25 +0200 Subject: easy change locale for testing and developping translations --- app/controllers/application_controller.rb | 5 ++++- app/views/line_referentials/show.html.slim | 9 ++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) (limited to 'app') diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index f2c9b4c6f..42b7c2a25 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -12,7 +12,10 @@ class ApplicationController < ActionController::Base helper LanguageEngine::Engine.helpers def set_locale - I18n.locale = session[:language] || I18n.default_locale + # I18n.locale = session[:language] || I18n.default_locale + # For testing different locales w/o restarting the server + I18n.locale = (params['lang'] || session[:language] || I18n.default_locale).to_sym + logger.info "locale set to #{I18n.locale.inspect}" end def pundit_user diff --git a/app/views/line_referentials/show.html.slim b/app/views/line_referentials/show.html.slim index 5c0df1a71..7d4067202 100644 --- a/app/views/line_referentials/show.html.slim +++ b/app/views/line_referentials/show.html.slim @@ -27,9 +27,12 @@ table.table thead tr - th Synchronisé - th Statut - th Message + / th Synchronisé + th = t('.synchronized') + / th Statut + th = t('.status') + / th Message + th = t('.message') tbody - @line_referential.line_referential_syncs.each_with_index do |sync, i| -- cgit v1.2.3