GRN2-166: Fixed issue with language fallback not working (Fixed #593) (#602)

* Fixed issue with language fallback not working

* Rubocop fixes
This commit is contained in:
farhatahmad 2019-07-08 09:02:34 -04:00 committed by Jesus Federico
parent e153528fcc
commit 7828c15286
5 changed files with 14 additions and 10 deletions

View File

@ -18,10 +18,11 @@
<div class="row pt-9">
<div class="col-lg-8 col-sm-12">
<div id="room-title" class="display-3 form-inline <%= 'edit_hover_class' if current_user.main_room != @room %>">
<h1 contenteditable=false id="user-text" class="display-3 text-left mb-3 font-weight-400"><%= @room.name %></h1>
<% if current_user.main_room == @room %>
<h1 contenteditable=false id="user-text" class="display-3 text-left mb-3 font-weight-400"><%= t("home_room") %></h1>
<a class="disable-click"><i class="fas fa-home align-top home-indicator ml-2"></i></a>
<% else %>
<h1 contenteditable=false id="user-text" class="display-3 text-left mb-3 font-weight-400"><%= @room.name %></h1>
<a><i id="edit-room" class="fa fa-edit align-top home-indicator ml-2" data-edit-room="<%= @room.uid %>"></i></a>
<% end %>
</div>

View File

@ -28,7 +28,11 @@
</td>
<td>
<div id="room-name">
<h4 contenteditable="false" class="m-0 force-text-normal" ><%= room.name %></h4>
<% if room == current_user.main_room %>
<h4 contenteditable="false" class="m-0 force-text-normal" ><%= t("home_room") %></h4>
<% else %>
<h4 contenteditable="false" class="m-0 force-text-normal" ><%= room.name %></h4>
<% end %>
</div>
<div id="room-name-editable" style="display: none">
<input id="room-name-editable-input" class="form-control input-sm w-100 h-4" value="<%= room.name %>">

View File

@ -37,10 +37,6 @@ module Greenlight
config.i18n.available_locales = [:en]
config.i18n.default_locale = :en
config.i18n.available_locales.each do |locale|
config.i18n.fallbacks[locale] = [locale, :en]
end
# Check if a loadbalancer is configured.
config.loadbalanced_configuration = ENV["LOADBALANCER_ENDPOINT"].present? && ENV["LOADBALANCER_SECRET"].present?

View File

@ -84,10 +84,6 @@ Rails.application.configure do
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
# config.action_mailer.raise_delivery_errors = false
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
# the I18n.default_locale when a translation cannot be found).
config.i18n.fallbacks = true
# Send deprecation notices to registered listeners.
config.active_support.deprecation = :notify

View File

@ -10,3 +10,10 @@ locales.each do |loc|
end
Rails.configuration.i18n.available_locales = configured_languages
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
# the I18n.default_locale when a translation cannot be found).
Rails.configuration.i18n.fallbacks = {}
Rails.configuration.i18n.available_locales.each do |locale|
Rails.configuration.i18n.fallbacks[locale] = :en
end