feat(lang) add upper sorbian to transcription languages

* fix showing transcripts for country codes longer than 2 characters
This commit is contained in:
zobadaniel
2024-05-24 15:18:38 +02:00
committed by GitHub
parent 0913554af9
commit d49a419284
4 changed files with 8 additions and 2 deletions

View File

@@ -34,6 +34,7 @@
"hi": "Hindi",
"hmn": "Hmong",
"hr": "Croatian",
"hsb": "Upper Sorbian",
"ht": "Haitian Creole",
"hu": "Hungarian",
"hy": "Armenian",

View File

@@ -172,8 +172,11 @@ function _endpointMessageReceived(store: IStore, next: Function, action: AnyActi
}
}
// If the suer is not requesting transcriptions just bail.
if (json.language.slice(0, 2) !== language) {
// If the user is not requesting transcriptions just bail.
// Regex to filter out all possible country codes after language code:
// this should catch all notations like 'en-GB' 'en_GB' and 'enGB'
// and be independent of the country code length
if (json.language.replace(/[-_A-Z].*/, '') !== language) {
return next(action);
}

View File

@@ -20,6 +20,7 @@
"hi": "hi-IN",
"mr": "mr-IN",
"hr": "hr-HR",
"hsb": "hsb-DE",
"hu": "hu-HU",
"hy": "hy-AM",
"id": "id-ID",

View File

@@ -45,6 +45,7 @@
"is-IS": "Icelandic (Iceland)",
"it-IT": "Italian (Italy)",
"lt-LT": "Lithuanian (Lithuania)",
"hsb-DE": "Upper Sorbian (Germany)",
"hu-HU": "Hungarian (Hungary)",
"nl-NL": "Dutch (Netherlands)",
"no-NO": "Norwegian Bokmål (Norway)",