Fix language filter codes (#4841)
* Fix language filter codes CLD3 returns BCP-47 language identifier, filter settings expect identifiers in the ISO 639-1 format. Convert between formats, and exclude duplicate languages from filter choices (zh-CN->zh) * Fix zh name
This commit is contained in:
parent
95f018a3d4
commit
1caf11ddcc
6 changed files with 21 additions and 4 deletions
|
@ -30,6 +30,7 @@ module SettingsHelper
|
|||
th: 'ภาษาไทย',
|
||||
tr: 'Türkçe',
|
||||
uk: 'Українська',
|
||||
zh: '中文',
|
||||
'zh-CN': '简体中文',
|
||||
'zh-HK': '繁體中文(香港)',
|
||||
'zh-TW': '繁體中文(臺灣)',
|
||||
|
@ -39,6 +40,10 @@ module SettingsHelper
|
|||
HUMAN_LOCALES[locale]
|
||||
end
|
||||
|
||||
def filterable_languages
|
||||
I18n.available_locales.map { |locale| locale.to_s.split('-').first.to_sym }.uniq
|
||||
end
|
||||
|
||||
def hash_to_object(hash)
|
||||
HashObject.new(hash)
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue