Files
upstream-jitsi-meet/react/features/base/i18n/configLanguageDetector.ts
upstream-mirror 1d2bfcac0c
Some checks failed
Prosody Plugin Tests / test (push) Failing after 10m11s
Close stale issues and PRs / stale (push) Failing after 1s
snapshot of https://github.com/jitsi/jitsi-meet.git @ fd1749dd28f4138aa80234fc7f311b19aaffa0e7 (2026-09-15)
2026-09-15 15:56:32 +05:00

28 lines
773 B
TypeScript

import { noop } from 'lodash-es';
/**
* Custom language detection, just returns the config property if any.
*
* When config.js has not yet been loaded (e.g. SSI did not inject it and we
* are fetching it asynchronously via appNavigate), this returns undefined so
* other detectors in the chain take over. Once SET_CONFIG dispatches, the
* i18n middleware applies defaultLanguage from the store via changeLanguage.
*/
export default {
cacheUserLanguage: noop,
/**
* Looks the language up in the config.
*
* @returns {string | undefined} The default language if available.
*/
lookup() {
return window.config?.defaultLanguage;
},
/**
* Name of the language detector.
*/
name: 'configLanguageDetector'
};