Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

fix(i18n) Fix showing Afrikaans when set language is not found (#16245)

Horatiu Muresan1a34ed9a2d12
diff --git a/lang/main.json b/lang/main.json
index f632060e06..4644e436bd 100644
--- a/lang/main.json
+++ b/lang/main.json
@@ -377,9 +377,6 @@
"moderationAudioLabel": "Allow attendees to unmute themselves",
"moderationDesktopLabel": "Allow non-moderators to share their screen",
"moderationVideoLabel": "Allow non-moderators to start their video",
- "muteEveryonesDesktopDialog": "The participants can share their screen at any time.",
- "muteEveryonesDesktopDialogModerationOn": "The participants can send a request to share their screen at any time.",
- "muteEveryonesDesktopTitle": "Stop everyone's screen share?",
"muteEveryoneDialog": "The participants can unmute themselves at any time.",
"muteEveryoneDialogModerationOn": "The participants can send a request to speak at any time.",
"muteEveryoneElseDialog": "Once muted, you won't be able to unmute them, but they can unmute themselves at any time.",
@@ -391,6 +388,9 @@
"muteEveryoneSelf": "yourself",
"muteEveryoneStartMuted": "Everyone starts muted from now on",
"muteEveryoneTitle": "Mute everyone?",
+ "muteEveryonesDesktopDialog": "The participants can share their screen at any time.",
+ "muteEveryonesDesktopDialogModerationOn": "The participants can send a request to share their screen at any time.",
+ "muteEveryonesDesktopTitle": "Stop everyone's screen share?",
"muteEveryonesVideoDialog": "The participants can turn on their video at any time.",
"muteEveryonesVideoDialogModerationOn": "The participants can send a request to turn on their video at any time.",
"muteEveryonesVideoDialogOk": "Disable",
diff --git a/react/features/settings/functions.any.ts b/react/features/settings/functions.any.ts
index d0edbccab5..106f1f3133 100644
--- a/react/features/settings/functions.any.ts
+++ b/react/features/settings/functions.any.ts
@@ -91,6 +91,23 @@ export function getNotificationsMap(stateful: IStateful): { [key: string]: boole
}, {});
}
+function normalizeCurrentLanguage(language: string) {
+ if (!language) {
+ return;
+ }
+
+ const [ country, lang ] = language.split('-');
+ const jitsiNormalized = `${country}${lang ?? ''}`;
+
+ if (LANGUAGES.includes(jitsiNormalized)) {
+ return jitsiNormalized;
+ }
+
+ if (LANGUAGES.includes(country)) {
+ return country;
+ }
+}
+
/**
* Returns the properties for the "More" tab from settings dialog from Redux
* state.
@@ -102,7 +119,7 @@ export function getNotificationsMap(stateful: IStateful): { [key: string]: boole
export function getMoreTabProps(stateful: IStateful) {
const state = toState(stateful);
const stageFilmstripEnabled = isStageFilmstripEnabled(state);
- const language = i18next.language || DEFAULT_LANGUAGE;
+ const language = normalizeCurrentLanguage(i18next.language) || DEFAULT_LANGUAGE;
const configuredTabs: string[] = interfaceConfig.SETTINGS_SECTIONS || [];
// when self view is controlled by the config we hide the settings