您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

languageDetector.native.js 488B

1234567891011121314151617181920212223242526
  1. // @flow
  2. import { NativeModules } from 'react-native';
  3. /**
  4. * The singleton language detector for React Native which uses the system-wide
  5. * locale.
  6. */
  7. export default {
  8. /**
  9. * Does not support caching.
  10. *
  11. * @returns {void}
  12. */
  13. cacheUserLanguage: Function.prototype,
  14. detect() {
  15. const { LocaleDetector } = NativeModules;
  16. return LocaleDetector.locale.replace(/_/, '-');
  17. },
  18. init: Function.prototype,
  19. type: 'languageDetector'
  20. };