GRN2-178: Generalized use of language_name based on Mozilla Mapping (#613)

* GRN2-178: Generalized use of language_name based on Moxilla Mapping

* Fixed issues catched by rubocop

* MAke sure the file with data exists

* Removed language mapping from local code
This commit is contained in:
Jesus Federico
2019-07-09 12:24:30 -04:00
committed by GitHub
parent 5d4bd1b851
commit a3158b5872
20 changed files with 114 additions and 372 deletions

View File

@ -17,10 +17,12 @@
# with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
require 'bbb_api'
require 'i18n/language/mapping'
module ApplicationHelper
include MeetingsHelper
include BbbApi
include I18n::Language::Mapping
# Gets all configured omniauth providers.
def configured_providers
@ -54,9 +56,8 @@ module ApplicationHelper
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])
language_mapping = I18n::Language::Mapping.language_mapping_list[locale.to_s.gsub("_", "-")]
language_opts.push([language_mapping["nativeName"], locale.to_s])
end
language_opts.sort
end