GRN-86: Change the way the locales are handled (#417)

* Changed the way locales are shown

* Updated the rest of the locales

* Changed the way available_locales are defined

* Updated locales in Russian

* Updated locaales for German
This commit is contained in:
Jesus Federico
2019-03-28 11:02:36 -04:00
committed by GitHub
parent 7474a3c6a0
commit 5ba5b663ac
18 changed files with 30 additions and 819 deletions

View File

@ -48,9 +48,12 @@ module ApplicationHelper
# Returns language selection options
def language_options
language_opts = [['<<<< ' + t("language_options.default") + ' >>>>', "default"]]
Rails.configuration.languages.each do |loc|
language_opts.push([t("language_options." + loc), loc])
locales = I18n.available_locales
language_opts = [['<<<< ' + t("language_default") + ' >>>>', "default"]]
locales.each do |locale|
language_name = t("language_name", locale: locale)
language_name = locale.to_s if locale != :en && language_name == 'English'
language_opts.push([language_name, locale.to_s])
end
language_opts.sort
end