128 lines
5.6 KiB
TypeScript
128 lines
5.6 KiB
TypeScript
/* Metro module 1949; source: modules/user_settings/LocaleStore.tsx; dependencies: [6, 7, 15, 17, 18, 5, 1950, 1348, 3767, 1244, 566, 694, 2] */
|
|
function _fun21718(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#21718, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2076:6, offset: 0x00ef7ff1, size: 435 bytes, params: 8, frame: 20
|
|
const env0_0 = require;
|
|
const closure = OVERLAY_INITIALIZE_21726;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_3 = importDefault(6) /* metro dependency 6 */;
|
|
const env0_4 = importDefault(7) /* metro dependency 7 */;
|
|
const env0_5 = importDefault(15) /* metro dependency 15 */;
|
|
const env0_6 = importDefault(17) /* metro dependency 17 */;
|
|
const env0_7 = importDefault(18) /* metro dependency 18 */;
|
|
const env0_8 = importDefault(5) /* metro dependency 5 */;
|
|
const env0_9 = (require(1950) /* metro dependency 1950: IntlLoaderStore */).setAppLocale;
|
|
const userSettingsProtoStore = importDefault(1348) /* metro dependency 1348: UserSettingsProtoStore */;
|
|
let env0_11 = (require(1244) /* metro dependency 1244: indexNative */).intl.currentLocale;
|
|
let env0_12 = (require(1244) /* metro dependency 1244: indexNative */).systemLocale;
|
|
(function() {
|
|
return _getSystemLocale.apply(this, arguments);
|
|
})().then(function(a0) {
|
|
env0_12 = a0;
|
|
});
|
|
const Store = (importDefault(566) /* metro dependency 566: flux */).Store;
|
|
_fun21729(Store).displayName = 'LocaleStore';
|
|
value = new value(importDefault(694) /* metro dependency 694: Dispatcher */, {OVERLAY_INITIALIZE: closure,
|
|
CACHE_LOADED: closure, CONNECTION_OPEN: closure, USER_SETTINGS_PROTO_UPDATE: closure,
|
|
USER_SETTINGS_LOCALE_OVERRIDE: function({locale}) {
|
|
env0_11 = locale;
|
|
setAppLocale(locale);
|
|
}});
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/user_settings/LocaleStore.tsx');
|
|
exports.default = value;
|
|
}
|
|
|
|
function _isNativeReflectConstruct_21719() { // fn#21719, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2076:191, offset: 0x00ef81a4, size: 94 bytes, params: 1, frame: 18
|
|
var Boolean;
|
|
var prototype;
|
|
var valueOf;
|
|
var call;
|
|
var Reflect;
|
|
var construct;
|
|
var closure;
|
|
var value;
|
|
var error;
|
|
try {
|
|
Boolean = global.Boolean;
|
|
prototype = Boolean.prototype;
|
|
valueOf = prototype.valueOf;
|
|
call = valueOf.call;
|
|
Reflect = global.Reflect;
|
|
construct = Reflect.construct;
|
|
Boolean = global.Boolean;
|
|
closure = function() {
|
|
};
|
|
value = Reflect.apply(construct, Reflect, [Boolean, [], closure]);
|
|
value = Reflect.apply(call, valueOf, [value]);
|
|
var result = !value;
|
|
} catch (error) {
|
|
}
|
|
return (_isNativeReflectConstruct_21719_isNativeReflectConstruct = function() {
|
|
return !!result;
|
|
})();
|
|
}
|
|
|
|
function _getSystemLocale() { // fn#21722, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2076:384, offset: 0x00ef8202, size: 48 bytes, params: 1, frame: 14
|
|
return env0_8(_fun21724).apply(this, arguments);
|
|
}
|
|
|
|
function CACHE_LOADED_21726() { // fn#21726, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2076:751, offset: 0x00ef8301, size: 98 bytes, params: 1, frame: 14
|
|
const localization = UserSettingsProtoStore.settings.localization;
|
|
const r2 = localization == null || localization.locale == null ? undefined : localization.locale.value;
|
|
let r0 = r2 != null && r2 !== '' && r2 !== currentLocale;
|
|
if (r0) {
|
|
setAppLocale(r2);
|
|
r0 = true;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function _fun21729(a0) { // fn#21729, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2076:996, offset: 0x00ef8371, size: 114 bytes, params: 2, frame: 16
|
|
const closure = LocaleStore;
|
|
env0_7(closure, a0);
|
|
return env0_4(closure, [{key: 'initialize', value: function() {
|
|
this.waitFor(UserSettingsProtoStore);
|
|
OVERLAY_INITIALIZE_21726();
|
|
setAppLocale(currentLocale);
|
|
}}, {key: 'locale', get: function() {
|
|
return currentLocale;
|
|
}}, {key: 'systemLocale', get: function() {
|
|
return systemLocale;
|
|
}}]);
|
|
}
|
|
|
|
function* _fun21724() { // fn#21724, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2076:439, offset: 0x00ef823b, size: 198 bytes, params: 1, frame: 16
|
|
var environment;
|
|
var getPreferredSystemLanguages;
|
|
var app;
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
value = environment.__proto__.__proto__;
|
|
const binding = env2_1;
|
|
const value3 = undefined;
|
|
if (binding(env2_2[8]) == null) {
|
|
getPreferredSystemLanguages = value3;
|
|
} else {
|
|
app = env2_1(env2_2[8]).app;
|
|
getPreferredSystemLanguages = app == null ? value3 : app.getPreferredSystemLanguages;
|
|
}
|
|
if (getPreferredSystemLanguages != null) {
|
|
var preferredSystemLanguages = env2_1(env2_2[8]).app.getPreferredSystemLanguages();
|
|
yield preferredSystemLanguages.then(function(a0) {
|
|
return a0[0];
|
|
});
|
|
var value6 = undefined;
|
|
if (false) {
|
|
return value6;
|
|
}
|
|
if (value6 == null) {
|
|
return env2_0(env2_2[9]).systemLocale;
|
|
}
|
|
if (value6 !== '') {
|
|
return value6;
|
|
}
|
|
}
|
|
return env2_0(env2_2[9]).systemLocale;
|
|
}
|
|
|