From c8a799bce85636e95f7ee136d5b5411978fa4e88 Mon Sep 17 00:00:00 2001 From: Jesus Federico Date: Tue, 16 Apr 2019 17:08:17 -0400 Subject: [PATCH] HOT-FIX: Issue with changes with the language file name (#466) * HOT-FIX: Issue with changes with the language file name * Rubocop! --- app/controllers/application_controller.rb | 2 +- app/helpers/sessions_helper.rb | 2 +- config/locales/es.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index e8dfd653..497a9579 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -45,7 +45,7 @@ class ApplicationController < ActionController::Base def update_locale(user) I18n.locale = if user && user.language != 'default' - user.language + user.language.tr('-', '_') else http_accept_language.language_region_compatible_from(I18n.available_locales) end diff --git a/app/helpers/sessions_helper.rb b/app/helpers/sessions_helper.rb index 86748dcd..510933d2 100644 --- a/app/helpers/sessions_helper.rb +++ b/app/helpers/sessions_helper.rb @@ -64,7 +64,7 @@ module SessionsHelper end def parse_user_domain(hostname) - return hostname.split('.').first unless Rails.configuration.url_host + return hostname.split('.').first if Rails.configuration.url_host.empty? Rails.configuration.url_host.split(',').each do |url_host| if hostname.include?(url_host) return hostname.chomp(url_host).chomp('.') diff --git a/config/locales/es.yml b/config/locales/es.yml index 2cfb5e9d..a69e7fe8 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -93,7 +93,7 @@ es: video: Ve nuestro tutorial de como utilizar Greenlight upgrade: Muestrame como actualizar a versión 2.0 version: Hemos publicado una nueva version de Greenlight pero tu base de datos no es compatible. - language_name: Español (México) + language_name: Español language_default: Por omisión (idioma del navegador) ldap_error: No se puede conectar al servidor LDAP. Compruebe la configuración de LDAP en el archivo "env" y asegúrate de que tu servidor está ejecutándose. login: Ingresar