mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2026-05-18 10:27:47 +00:00
27 lines
490 B
JavaScript
27 lines
490 B
JavaScript
// @flow
|
|
|
|
import { NativeModules } from 'react-native';
|
|
|
|
/**
|
|
* The singleton language detector for React Native which uses the system-wide
|
|
* locale.
|
|
*/
|
|
export default {
|
|
/**
|
|
* Does not support caching.
|
|
*
|
|
* @returns {void}
|
|
*/
|
|
cacheUserLanguage: Function.prototype,
|
|
|
|
detect() {
|
|
const { LocaleDetector } = NativeModules;
|
|
|
|
return LocaleDetector.locale.replace(/[_-]/, '');
|
|
},
|
|
|
|
init: Function.prototype,
|
|
|
|
type: 'languageDetector'
|
|
};
|