diff --git a/app/helpers/languages_helper.rb b/app/helpers/languages_helper.rb index cbf5638ae4..bc4287c724 100644 --- a/app/helpers/languages_helper.rb +++ b/app/helpers/languages_helper.rb @@ -223,7 +223,14 @@ module LanguagesHelper 'zh-YUE': ['Cantonese', '廣東話'].freeze, }.freeze - SUPPORTED_LOCALES = {}.merge(ISO_639_1).merge(ISO_639_1_REGIONAL).merge(ISO_639_3).freeze + # Since nan is not translated but nan-TW is translated, + # to enable the ISO-639-3 language-code with the regional variant but no + # official name, we use a specific hash for nan-TW + ISO_639_3_REGIONAL = { + 'nan-TW': ['Hokkien (Taiwan)', '臺語 (Hô-ló話)'].freeze, + }.freeze + + SUPPORTED_LOCALES = {}.merge(ISO_639_1).merge(ISO_639_1_REGIONAL).merge(ISO_639_3).merge(ISO_639_3_REGIONAL).freeze # For ISO-639-1 and ISO-639-3 language codes, we have their official # names, but for some translations, we need the names of the @@ -233,7 +240,6 @@ module LanguagesHelper 'es-AR': 'Español (Argentina)', 'es-MX': 'Español (México)', 'fr-CA': 'Français (Canadien)', - 'nan-TW': '臺語 (Hô-ló話)', 'pt-BR': 'Português (Brasil)', 'pt-PT': 'Português (Portugal)', 'sr-Latn': 'Srpski (latinica)',