decord/source/1292_DEFAULT_LOCALE.js
2026-08-04 21:03:28 +00:00

148 lines
4.3 KiB
JavaScript

// Module ID: 1292
// Function ID: 1293
// Name: DEFAULT_LOCALE
// Dependencies: [32, 41, 42, 1276, 1275, 1278]
// Module 1292 (DEFAULT_LOCALE)
import _slicedToArray from "_slicedToArray";
import _classCallCheck from "_classCallCheck";
import _createClass from "_createClass";
const IntlManager = require;
class IntlManager {
constructor(arg0) {
self = this;
self = this;
DEFAULT_LOCALE = global.initialLocale;
if (DEFAULT_LOCALE === undefined) {
tmp = closure_1;
DEFAULT_LOCALE = closure_1.DEFAULT_LOCALE;
}
DEFAULT_LOCALE2 = global.defaultLocale;
if (DEFAULT_LOCALE2 === undefined) {
tmp2 = closure_1;
DEFAULT_LOCALE2 = closure_1.DEFAULT_LOCALE;
}
DEFAULT_FORMAT_CONFIG = global.formatConfig;
if (DEFAULT_FORMAT_CONFIG === undefined) {
tmp3 = IntlManager;
tmp4 = closure_2;
DEFAULT_FORMAT_CONFIG = require("resolveFormatConfigOptions").DEFAULT_FORMAT_CONFIG;
}
flag = global.forceLookupMatcher;
if (flag === undefined) {
flag = false;
}
tmp5 = outer1_4(self, self);
self.onLocaleChange = (arg0) => {
const _self = arg0;
let _localeSubscriptions = _self._localeSubscriptions;
_localeSubscriptions.add(arg0);
return () => {
_localeSubscriptions = _localeSubscriptions._localeSubscriptions;
return _localeSubscriptions.delete(_localeSubscriptions);
};
};
self.currentLocale = DEFAULT_LOCALE;
self.defaultLocale = DEFAULT_LOCALE2;
self.formatConfig = DEFAULT_FORMAT_CONFIG;
self._forceLookupMatcher = flag;
items = [, ];
({ currentLocale: arr[0], defaultLocale: arr[1] } = self);
self.data = require("makeDataFormatters").makeDataFormatters(items, self.formatConfig, self._forceLookupMatcher);
set = new Set();
self._localeSubscriptions = set;
return;
}
}
let items = [
{
key: "withFormatters",
value: function withFormatters(set) {
const self = this;
const entries = Object.entries(set);
while (tmp2 !== undefined) {
let tmp4 = _slicedToArray;
let tmp5 = _slicedToArray(tmp3, 2);
self[tmp5[0]] = self.makeFormatFunction(tmp5[1]);
continue;
}
return self;
}
},
{
key: "makeFormatFunction",
value: function makeFormatFunction(arg0) {
let exports;
let format;
const self = this;
({ format, builder: exports } = arg0);
let closure_0 = format.bind(this);
return (arg0, arg1) => {
let tmp = null;
if (null != arg0) {
tmp = callback(arg0(self.currentLocale), arg1, closure_1);
}
return tmp;
};
}
},
{
key: "setLocale",
value: function setLocale(currentLocale) {
this.currentLocale = currentLocale;
const items = [, ];
({ currentLocale: arr[0], defaultLocale: arr[1] } = this);
this.data = IntlManager(1275).makeDataFormatters(items, this.formatConfig, this._forceLookupMatcher);
this.emitLocaleChange(currentLocale);
}
},
{
key: "emitLocaleChange",
value: function emitLocaleChange(currentLocale) {
for (const item10007 of tmp) {
let item10007Result = item10007(arg0);
continue;
}
}
},
{
key: "string",
value: function string(arg0) {
let str = "";
if (null != arg0) {
const self = this;
str = arg0(this.currentLocale).reserialize();
const obj = arg0(this.currentLocale);
}
return str;
}
},
{
key: "reserialize",
value: function reserialize(arg0) {
if (null == arg0) {
return "";
} else {
const self = this;
const obj = arg0(this.currentLocale);
let reserializeResult = obj;
if (typeof obj !== "string") {
reserializeResult = obj.reserialize();
}
return reserializeResult;
}
}
},
{
key: "bindFormatValues",
value: function bindFormatValues(Builder, ast, values) {
const items = [, ];
({ currentLocale: arr[0], defaultLocale: arr[1] } = this);
return IntlManager(1278).bindFormatValues({ Builder, nodes: ast.ast, locales: items, dataFormatters: this.data, formatConfig: this.formatConfig, values, keyPrefix: "" });
}
}
];
export const DEFAULT_LOCALE = "en-US";
export const IntlManager = _createClass(IntlManager, items);