weifuwu 0.17.17 → 0.17.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +2 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1430,7 +1430,7 @@ function buildHeadPayload(opts) {
|
|
|
1430
1430
|
result += `<link rel="stylesheet" href="${base}/__wfw/style.css" />
|
|
1431
1431
|
`;
|
|
1432
1432
|
}
|
|
1433
|
-
const localeData = ctx.parsed?.__localeData;
|
|
1433
|
+
const localeData = ctx.parsed?.__localeData ?? globalThis.__LOCALE_DATA__;
|
|
1434
1434
|
if (localeData && Object.keys(localeData).length > 0) {
|
|
1435
1435
|
result += `<script>window.__LOCALE_DATA__=${JSON.stringify(localeData)}</script>
|
|
1436
1436
|
`;
|
|
@@ -7227,6 +7227,7 @@ function preferences(options) {
|
|
|
7227
7227
|
if (dir) {
|
|
7228
7228
|
const msgs = await load(locale);
|
|
7229
7229
|
ctx.t = (key, params, fallback) => translate(msgs, key, params, fallback);
|
|
7230
|
+
globalThis.__LOCALE_DATA__ = msgs;
|
|
7230
7231
|
ctx.parsed = { ...ctx.parsed, __localeData: msgs };
|
|
7231
7232
|
}
|
|
7232
7233
|
ctx.setPref = (name, value) => {
|