snapshot of https://github.com/jitsi/jitsi-meet.git @ fd1749dd28f4138aa80234fc7f311b19aaffa0e7 (2026-09-15)
This commit is contained in:
27
react/features/base/i18n/configLanguageDetector.ts
Normal file
27
react/features/base/i18n/configLanguageDetector.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
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'
|
||||
};
|
||||
Reference in New Issue
Block a user