decord/source/modules/intl/native/IntlTestingSettingsPage.tsx
github-actions f0f877e8ce chore: update source for alpha 347.1
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4824.js (118.4 MB)
2026-09-15 14:23:42 +00:00

190 lines
8 KiB
TypeScript

// Module ID: 15722
// Function ID: 15723
// Name: IntlTestingSettingsPage
// Dependencies: [32, 5, 19, 17, 2027, 2026, 21, 4639, 576, 5770, 1115, 9490, 5773, 504, 4231, 5772, 5690, 1154, 5057, 4635, 15723, 15755, 2]
// Exports: default
// Module 15722 (IntlTestingSettingsPage)
import initialize from "initialize" /* 504 */;
import nativeDefault from "native" /* 576 */;
import util from "util" /* 1115 */;
import _mod1154 from "module_1154" /* 1154 */;
import _modDef4231 from "module_4231" /* 4231 */;
import TableRow from "TableRow" /* 5690 */;
import TableRowGroup from "TableRowGroup" /* 5772 */;
import _modDef15723 from "module_15723" /* 15723 */;
import _modDef15755 from "module_15755" /* 15755 */;
import _slicedToArray from "module_32" /* 32 */;
import asyncGeneratorStep from "asyncGeneratorStep" /* 5 */;
import noop from "module_19" /* 19 */;
import LocaleStore from "LocaleStore" /* 2026 */;
const require = globalThis.__r;
require = fn;
function TestLocaleSelector() {
const obj = { title: "Locale", hasIcons: false, defaultValue: require("util").intl.currentLocale, onChange: null, children: null };
_require = asyncGeneratorStep(async (arg0, value) => {
if (c4 === 2) {
c4 = 3;
throw new TypeError("Generator functions may not be called on executing generators");
} else if (tmp4 === 3) {
if (arg0 === 1) {
throw value;
} else if (arg0 === 2) {
const obj2 = { value, done: true };
return obj2;
} else {
return { value: "HermesInternal", done: null };
}
} else {
try {
c4 = 2;
if (0 === c3) {
if (arg0 === 1) {
c4 = 3;
throw value;
} else if (arg0 === 2) {
c4 = 3;
const obj3 = { value, done: true };
return obj3;
} else {
closure_129_0 = closure_0;
c3 = 1;
c4 = 1;
const obj4 = { value: setAppLocale(closure_0), done: false };
return obj4;
}
} else if (arg0 === 1) {
c4 = 3;
throw value;
} else if (arg0 === 2) {
c4 = 3;
const obj5 = { value, done: true };
return obj5;
} else {
tmp2(tmp5[11]).updateLocale(closure_129_0);
c4 = 3;
return { value: "HermesInternal", done: null };
}
} catch (tmp14) {
c4 = tmp;
throw tmp14;
}
}
});
obj.onChange = function() {
const self = this;
const apply = closure_0.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
};
const items = [closure_10(require("TableRadioRow").TableRadioRow, { label: "English", value: "en-US" }), closure_10(require("TableRadioRow").TableRadioRow, { label: "French", value: "fr" })];
obj.children = items;
return closure_11(require("TableRadioGroup").TableRadioGroup, obj);
}
function LocaleInfo() {
let items = [LocaleStore];
const tmp = _slicedToArray(initialize.useStateFromStoresArray(items, () => {
const items = [, ];
({ locale: arr[0], systemLocale: arr[1] } = LocaleStore);
return items;
}), 2);
const first = tmp[0];
[tmp4, require] = noop.useState(_modDef4231.locale);
const items1 = [first];
const effect = noop.useEffect(() => {
const timerId = setTimeout(() => {
closure_1_0(_modDef4231.locale());
}, 0);
}, items1);
const tmp3 = _slicedToArray(noop.useState(_modDef4231.locale), 2);
const obj2 = _modDef4231;
const tmp6 = closure_11;
const tmp7 = closure_10;
const items2 = [closure_10(TableRow.TableRow, { label: "Active System", trailing: closure_10(TableRow.TableRow.TrailingText, { text: "@discord/intl" }) }), , , , ];
const obj3 = { label: "Active System", trailing: closure_10(TableRow.TableRow.TrailingText, { text: "@discord/intl" }) };
items2[1] = closure_10(TableRow.TableRow, { label: "App locale", trailing: closure_10(TableRow.TableRow.TrailingText, { text: first }) });
const obj4 = { label: "App locale", trailing: closure_10(TableRow.TableRow.TrailingText, { text: first }) };
items2[2] = closure_10(TableRow.TableRow, { label: "System locale", trailing: closure_10(TableRow.TableRow.TrailingText, { text: tmp[1] }) });
const obj6 = { label: "@discord/intl locale", trailing: null };
const obj5 = { label: "System locale", trailing: closure_10(TableRow.TableRow.TrailingText, { text: tmp[1] }) };
obj6.trailing = closure_10(TableRow.TableRow.TrailingText, { text: util.intl.currentLocale });
items2[3] = closure_10(TableRow.TableRow, obj6);
const obj8 = { label: "Moment locale", trailing: closure_10(TableRow.TableRow.TrailingText, { text: tmp4 }), subLabel: null };
let str = "Locale data does not match";
if (tmp4 === obj2.localeData()._abbr) {
str = "Locale data matches current locale";
}
const obj9 = { hasIcons: false, children: null };
obj8.subLabel = str;
items2[4] = tmp7(TableRow.TableRow, obj8);
obj9.children = items2;
return tmp6(TableRowGroup.TableRowGroup, obj9);
}
get_ActivityIndicator = fn(17);
({ View: metroRequire, ScrollView: closure_7 } = get_ActivityIndicator);
const setAppLocale = fn(2027).setAppLocale;
const jsxProd = fn(21);
({ jsx: c10, jsxs: closure_11 } = jsxProd);
const createStyles = fn(4639);
let obj2 = { wrap: { backgroundColor: nativeDefault.colors.BACKGROUND_BASE_LOW }, container: { padding: 16 } };
let closure_12 = createStyles.createStyles(obj2);
const size = fn(2);
let result = size.fileFinishedImporting("modules/intl/native/IntlTestingSettingsPage.tsx");
export default function IntlTestingSettingsPage() {
const tmp = closure_12();
const syncExternalStore = noop.useSyncExternalStore(require("util").intl.onLocaleChange, () => closure_0(1115).intl.currentLocale);
_require = _slicedToArray(noop.useState({}), 2)[1];
const effect = noop.useEffect(() => {
const result = _mod1154.waitForAllDefaultIntlMessagesLoaded();
result.then(() => {
closure_1_0({});
});
}, []);
let obj = { style: tmp.wrap, children: null };
const obj2 = { spacing: 24, style: tmp.container, children: null };
const items = [closure_10(LocaleInfo, {}), closure_10(TestLocaleSelector, {}), , , , , , ];
const obj3 = { variant: "text-md/normal", children: null };
const intl = require("util").intl;
obj3.children = intl.format(_modDef15723.HMvEC5, {});
items[2] = closure_10(require("Text/Text").Text, obj3);
const obj4 = { variant: "text-md/normal", children: null };
const intl2 = require("util").intl;
obj4.children = intl2.format(_modDef15755.swfLzV, {});
items[3] = closure_10(require("Text/Text").Text, obj4);
const obj5 = { variant: "text-md/normal", children: null };
const intl3 = require("util").intl;
obj5.children = intl3.format(_modDef15723.rmps8y, {});
items[4] = closure_10(require("Text/Text").Text, obj5);
const obj6 = { variant: "text-md/normal", children: null };
const intl4 = require("util").intl;
obj6.children = intl4.format(_modDef15723.uczI4g, {
linkTarget() {
}
});
items[5] = closure_10(require("Text/Text").Text, obj6);
const obj8 = { variant: "text-md/normal", children: null };
const intl5 = require("util").intl;
obj8.children = intl5.format(_modDef15723.rdfRyh, {});
items[6] = closure_10(require("Text/Text").Text, obj8);
const obj9 = { variant: "text-md/normal", children: null };
const intl6 = require("util").intl;
obj9.children = intl6.format(_modDef15723.XOdbAy, {
username: "some user",
usernameHook(children) {
const obj = { style: { backgroundColor: "green", borderRadius: 4, paddingHorizontal: 6, paddingVertical: 0 }, children: closure_1_10(closure_0(4635).Text, { variant: "text-sm/normal", color: "text-overlay-light", children }) };
return closure_1_10(closure_1_6, obj);
}
});
items[7] = closure_10(require("Text/Text").Text, obj9);
obj2.children = items;
obj.children = closure_11(require("Stack/Stack").Stack, obj2);
return closure_10(closure_7, obj);
};