@yozora-tech/qfluent 0.1.0 → 0.1.2
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/README.md +1 -11
- package/lib/assets/BDqr3vjM-bundle-graph.json +1 -0
- package/lib/assets/DLXuL6n7-bundle-graph.json +1 -0
- package/lib/index.qwik.cjs +11 -12
- package/lib/index.qwik.mjs +1 -10
- package/lib/q-manifest.json +25 -25
- package/lib/qfluent/context.d.ts +2 -2
- package/lib/qfluent/context.qwik.cjs +170 -181
- package/lib/qfluent/context.qwik.mjs +170 -166
- package/lib/qfluent/tools.qwik.cjs +16 -11
- package/lib/qfluent/tools.qwik.mjs +17 -12
- package/lib/qfluent/translate.qwik.cjs +77 -78
- package/lib/qfluent/translate.qwik.mjs +78 -81
- package/package.json +13 -6
- package/lib/assets/DVjQdr_6-bundle-graph.json +0 -1
- package/lib/assets/l4W0yvKV-bundle-graph.json +0 -1
package/README.md
CHANGED
|
@@ -20,17 +20,7 @@ const t_search_empty = useT("search-the-web");
|
|
|
20
20
|
- npm: https://www.npmjs.com/package/@yozora-tech/qfluent
|
|
21
21
|
- jsr: https://jsr.io/@yozora-tech/qfluent
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
### By Human
|
|
26
|
-
|
|
27
|
-
- `src/qfluent/*`
|
|
28
|
-
- `site/src/routes/*`
|
|
29
|
-
|
|
30
|
-
### By LLM
|
|
31
|
-
|
|
32
|
-
- `src/tests/*`
|
|
33
|
-
- `site/src/*.css`
|
|
23
|
+
See also [Dev Notes](./dev.md).
|
|
34
24
|
|
|
35
25
|
## Legal
|
|
36
26
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
["..\\index.qwik.mjs",4,5,"..\\qfluent\\context.qwik.mjs","..\\qfluent\\tools.qwik.mjs","..\\qfluent\\translate.qwik.mjs",3]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
["..\\index.qwik.cjs",4,5,"..\\qfluent\\context.qwik.cjs","..\\qfluent\\tools.qwik.cjs","..\\qfluent\\translate.qwik.cjs",3]
|
package/lib/index.qwik.cjs
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
exports.FluentProvider =
|
|
7
|
-
exports.
|
|
8
|
-
exports.
|
|
9
|
-
exports.
|
|
10
|
-
exports.
|
|
11
|
-
exports.
|
|
12
|
-
exports.
|
|
13
|
-
exports.
|
|
2
|
+
const require_context = require("./qfluent/context.qwik.cjs");
|
|
3
|
+
const require_translate = require("./qfluent/translate.qwik.cjs");
|
|
4
|
+
const require_tools = require("./qfluent/tools.qwik.cjs");
|
|
5
|
+
exports.FluentProvider = require_context.FluentProvider;
|
|
6
|
+
exports.T = require_translate.T;
|
|
7
|
+
exports.parseAcceptLanguage = require_tools.parseAcceptLanguage;
|
|
8
|
+
exports.useFluentErrors = require_context.useFluentErrors;
|
|
9
|
+
exports.useFluentLocales = require_context.useFluentLocales;
|
|
10
|
+
exports.useFluentResources = require_context.useFluentResources;
|
|
11
|
+
exports.useLocalizedTitle = require_translate.useLocalizedTitle;
|
|
12
|
+
exports.useT = require_translate.useT;
|
package/lib/index.qwik.mjs
CHANGED
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
import { FluentProvider, useFluentErrors, useFluentLocales, useFluentResources } from "./qfluent/context.qwik.mjs";
|
|
2
2
|
import { T, useLocalizedTitle, useT } from "./qfluent/translate.qwik.mjs";
|
|
3
3
|
import { parseAcceptLanguage } from "./qfluent/tools.qwik.mjs";
|
|
4
|
-
export {
|
|
5
|
-
FluentProvider,
|
|
6
|
-
T,
|
|
7
|
-
parseAcceptLanguage,
|
|
8
|
-
useFluentErrors,
|
|
9
|
-
useFluentLocales,
|
|
10
|
-
useFluentResources,
|
|
11
|
-
useLocalizedTitle,
|
|
12
|
-
useT
|
|
13
|
-
};
|
|
4
|
+
export { FluentProvider, T, parseAcceptLanguage, useFluentErrors, useFluentLocales, useFluentResources, useLocalizedTitle, useT };
|
package/lib/q-manifest.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": "1",
|
|
3
|
-
"manifestHash": "
|
|
3
|
+
"manifestHash": "h4ylak",
|
|
4
4
|
"options": {
|
|
5
5
|
"target": "lib",
|
|
6
6
|
"buildMode": "development",
|
|
@@ -8,53 +8,53 @@
|
|
|
8
8
|
"type": "inline"
|
|
9
9
|
}
|
|
10
10
|
},
|
|
11
|
-
"bundleGraphAsset": "assets/
|
|
11
|
+
"bundleGraphAsset": "assets/DLXuL6n7-bundle-graph.json",
|
|
12
12
|
"injections": [],
|
|
13
13
|
"mapping": {},
|
|
14
14
|
"bundles": {
|
|
15
|
-
"
|
|
16
|
-
"size":
|
|
17
|
-
"total":
|
|
15
|
+
"..\\index.qwik.cjs": {
|
|
16
|
+
"size": 706,
|
|
17
|
+
"total": 18257,
|
|
18
18
|
"imports": [
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
19
|
+
"..\\qfluent\\context.qwik.cjs",
|
|
20
|
+
"..\\qfluent\\tools.qwik.cjs",
|
|
21
|
+
"..\\qfluent\\translate.qwik.cjs"
|
|
22
22
|
],
|
|
23
23
|
"origins": [
|
|
24
|
-
"src
|
|
24
|
+
"src\\index.ts"
|
|
25
25
|
],
|
|
26
26
|
"interactivity": 0
|
|
27
27
|
},
|
|
28
|
-
"
|
|
29
|
-
"size":
|
|
30
|
-
"total":
|
|
28
|
+
"..\\qfluent\\context.qwik.cjs": {
|
|
29
|
+
"size": 7046,
|
|
30
|
+
"total": 7046,
|
|
31
31
|
"origins": [
|
|
32
|
-
"src
|
|
32
|
+
"src\\qfluent\\context.tsx"
|
|
33
33
|
],
|
|
34
34
|
"interactivity": 0
|
|
35
35
|
},
|
|
36
|
-
"
|
|
37
|
-
"size":
|
|
38
|
-
"total":
|
|
36
|
+
"..\\qfluent\\tools.qwik.cjs": {
|
|
37
|
+
"size": 609,
|
|
38
|
+
"total": 609,
|
|
39
39
|
"origins": [
|
|
40
|
-
"src
|
|
40
|
+
"src\\qfluent\\tools.ts"
|
|
41
41
|
],
|
|
42
42
|
"interactivity": 0
|
|
43
43
|
},
|
|
44
|
-
"
|
|
45
|
-
"size":
|
|
46
|
-
"total":
|
|
44
|
+
"..\\qfluent\\translate.qwik.cjs": {
|
|
45
|
+
"size": 2850,
|
|
46
|
+
"total": 9896,
|
|
47
47
|
"imports": [
|
|
48
|
-
"
|
|
48
|
+
"..\\qfluent\\context.qwik.cjs"
|
|
49
49
|
],
|
|
50
50
|
"origins": [
|
|
51
|
-
"src
|
|
51
|
+
"src\\qfluent\\translate.tsx"
|
|
52
52
|
],
|
|
53
53
|
"interactivity": 0
|
|
54
54
|
}
|
|
55
55
|
},
|
|
56
56
|
"assets": {
|
|
57
|
-
"assets/
|
|
57
|
+
"assets/DLXuL6n7-bundle-graph.json": {
|
|
58
58
|
"name": "bundle-graph.json",
|
|
59
59
|
"size": 7
|
|
60
60
|
}
|
|
@@ -62,8 +62,8 @@
|
|
|
62
62
|
"symbols": {},
|
|
63
63
|
"platform": {
|
|
64
64
|
"vite": "",
|
|
65
|
-
"rollup": "4.
|
|
65
|
+
"rollup": "4.23.0",
|
|
66
66
|
"env": "deno",
|
|
67
|
-
"os": "
|
|
67
|
+
"os": "win32"
|
|
68
68
|
}
|
|
69
69
|
}
|
package/lib/qfluent/context.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { NoSerialize, Signal } from "@qwik.dev/core";
|
|
1
|
+
import { type Component, type NoSerialize, type Signal } from "@qwik.dev/core";
|
|
2
2
|
import type { FluentProviderProps, QwikFluentBundleMap, QwikFluentError, QwikFluentResourceMap } from "./types";
|
|
3
3
|
/** @internal */
|
|
4
4
|
export declare const FluentLocalesId: import("@qwik.dev/core").ContextId<Signal<string[]>>;
|
|
@@ -51,4 +51,4 @@ export declare function useFluentErrors(): Signal<QwikFluentError[]>;
|
|
|
51
51
|
* </body>
|
|
52
52
|
* ```
|
|
53
53
|
*/
|
|
54
|
-
export declare const FluentProvider:
|
|
54
|
+
export declare const FluentProvider: Component<FluentProviderProps>;
|
|
@@ -1,189 +1,178 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
)
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
const FluentLocalesId = core.createContextId("QwikFluentLocales");
|
|
28
|
-
const FluentResourcesId = core.createContextId("QwikFluentResources");
|
|
29
|
-
const FluentBundlesId = core.createContextId("QwikFluentBundles");
|
|
30
|
-
const FluentErrorsId = core.createContextId("QwikFluentErrors");
|
|
31
|
-
function useFluentLocales() {
|
|
32
|
-
return core.useContext(FluentLocalesId);
|
|
1
|
+
let _qwik_dev_core = require("@qwik.dev/core");
|
|
2
|
+
let _fluent_bundle = require("@fluent/bundle");
|
|
3
|
+
/** @internal */ var FluentLocalesId = (0, _qwik_dev_core.createContextId)("QwikFluentLocales");
|
|
4
|
+
/** @internal */ var FluentResourcesId = (0, _qwik_dev_core.createContextId)("QwikFluentResources");
|
|
5
|
+
/** @internal */ var FluentBundlesId = (0, _qwik_dev_core.createContextId)("QwikFluentBundles");
|
|
6
|
+
/** @internal */ var FluentErrorsId = (0, _qwik_dev_core.createContextId)("QwikFluentErrors");
|
|
7
|
+
/**
|
|
8
|
+
* Signal to list of preferred locales. Translations are picked from these languages, with fallbacks as needed.
|
|
9
|
+
*
|
|
10
|
+
* Normally you want to set this to `preferred_languages.concat(navigator.languages)`.
|
|
11
|
+
*
|
|
12
|
+
* ```tsx
|
|
13
|
+
* const locales = useFluentLocales();
|
|
14
|
+
* return (
|
|
15
|
+
* <select onChange$={(event, select) => {
|
|
16
|
+
* locales.value = [select.value].concat(navigator.languages);
|
|
17
|
+
* }}>
|
|
18
|
+
* <option value="ar">Arabic</option>
|
|
19
|
+
* <option value="en">English</option>
|
|
20
|
+
* <option value="ja">Japanese</option>
|
|
21
|
+
* ...
|
|
22
|
+
* </select>
|
|
23
|
+
* );
|
|
24
|
+
* ```
|
|
25
|
+
*/ function useFluentLocales() {
|
|
26
|
+
return (0, _qwik_dev_core.useContext)(FluentLocalesId);
|
|
33
27
|
}
|
|
34
|
-
|
|
35
|
-
|
|
28
|
+
/**
|
|
29
|
+
* Includes your resources and compiled FluentBundles by locales.
|
|
30
|
+
*
|
|
31
|
+
* You can make use of your custom resource properties with this.
|
|
32
|
+
*/ function useFluentResources() {
|
|
33
|
+
return (0, _qwik_dev_core.useContext)(FluentResourcesId);
|
|
36
34
|
}
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
/**
|
|
36
|
+
* Useful for debugging errors in resources.
|
|
37
|
+
*
|
|
38
|
+
* You can clear the errors after use.
|
|
39
|
+
*/ function useFluentErrors() {
|
|
40
|
+
return (0, _qwik_dev_core.useContext)(FluentErrorsId);
|
|
39
41
|
}
|
|
40
42
|
function ataToUtf8(pathname) {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
const bytes = new Uint8Array(binaryString.length);
|
|
48
|
-
for (let i = 0; i < binaryString.length; i++) {
|
|
49
|
-
bytes[i] = binaryString.charCodeAt(i);
|
|
50
|
-
}
|
|
51
|
-
return new TextDecoder().decode(bytes);
|
|
43
|
+
const a = pathname.indexOf(";base64,");
|
|
44
|
+
if (a === -1) throw new Error("Invalid ata url pathname: " + pathname);
|
|
45
|
+
const binaryString = atob(pathname.slice(a + 8));
|
|
46
|
+
const bytes = new Uint8Array(binaryString.length);
|
|
47
|
+
for (let i = 0; i < binaryString.length; i++) bytes[i] = binaryString.charCodeAt(i);
|
|
48
|
+
return new TextDecoder().decode(bytes);
|
|
52
49
|
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
break;
|
|
180
|
-
}
|
|
181
|
-
}, "FluentProvider_component_useTask_1_GdWGQNUVI4g", [
|
|
182
|
-
locales,
|
|
183
|
-
resmap,
|
|
184
|
-
ssr
|
|
185
|
-
]));
|
|
186
|
-
return /* @__PURE__ */ core._jsxSorted(core.Slot, null, null, null, 3, "76_0");
|
|
50
|
+
/**
|
|
51
|
+
* Use this in `src/root.tsx`.
|
|
52
|
+
*
|
|
53
|
+
* ```tsx
|
|
54
|
+
* <body>
|
|
55
|
+
* <FluentProvider resources={...}>
|
|
56
|
+
* <RouterOutlet />
|
|
57
|
+
* </FluentProvider>
|
|
58
|
+
* </body>
|
|
59
|
+
* ```
|
|
60
|
+
*/ var FluentProvider = /*#__PURE__*/ (0, _qwik_dev_core.componentQrl)(/*#__PURE__*/ (0, _qwik_dev_core.inlinedQrl)((_rawProps) => {
|
|
61
|
+
const locales = (0, _qwik_dev_core.useSignal)(_rawProps.acceptLanguage ?? ["en"]);
|
|
62
|
+
const bunmap = (0, _qwik_dev_core.useSignal)((0, _qwik_dev_core.noSerialize)({}));
|
|
63
|
+
const resmap = (0, _qwik_dev_core.useSignal)((0, _qwik_dev_core.noSerialize)({}));
|
|
64
|
+
const errors = (0, _qwik_dev_core.useSignal)((0, _qwik_dev_core.noSerialize)([]));
|
|
65
|
+
(0, _qwik_dev_core.useContextProvider)(FluentLocalesId, locales);
|
|
66
|
+
(0, _qwik_dev_core.useContextProvider)(FluentBundlesId, bunmap);
|
|
67
|
+
(0, _qwik_dev_core.useContextProvider)(FluentResourcesId, resmap);
|
|
68
|
+
(0, _qwik_dev_core.useContextProvider)(FluentErrorsId, errors);
|
|
69
|
+
const ssr = (0, _qwik_dev_core.useSignal)(true);
|
|
70
|
+
(0, _qwik_dev_core.useOnDocument)("load", /*#__PURE__*/ (0, _qwik_dev_core.inlinedQrl)(() => {
|
|
71
|
+
const locales = _qwik_dev_core._captures[0], ssr = _qwik_dev_core._captures[1];
|
|
72
|
+
if (!ssr.value) return;
|
|
73
|
+
ssr.value = false;
|
|
74
|
+
locales.value = navigator.languages.concat();
|
|
75
|
+
}, "FluentProvider_component_useOnDocument_9BL0L0WgLlY", [locales, ssr]));
|
|
76
|
+
(0, _qwik_dev_core.useTaskQrl)(/*#__PURE__*/ (0, _qwik_dev_core.inlinedQrl)((_rawProps1) => {
|
|
77
|
+
const _rawProps = _qwik_dev_core._captures[0], bunmap = _qwik_dev_core._captures[1], errors = _qwik_dev_core._captures[2], locales = _qwik_dev_core._captures[3], resmap = _qwik_dev_core._captures[4], ssr = _qwik_dev_core._captures[5];
|
|
78
|
+
_rawProps1.track(locales);
|
|
79
|
+
_rawProps1.track(ssr);
|
|
80
|
+
if (!bunmap.value) bunmap.value = (0, _qwik_dev_core.noSerialize)({});
|
|
81
|
+
if (!resmap.value) resmap.value = (0, _qwik_dev_core.noSerialize)({});
|
|
82
|
+
if (!errors.value) errors.value = (0, _qwik_dev_core.noSerialize)([]);
|
|
83
|
+
const res = (0, _qwik_dev_core.noSerialize)(resmap.value);
|
|
84
|
+
const bun = (0, _qwik_dev_core.noSerialize)(bunmap.value);
|
|
85
|
+
const promises = [];
|
|
86
|
+
const whitelist = locales.value;
|
|
87
|
+
let has_errors = false;
|
|
88
|
+
for (const r of _rawProps.resources) {
|
|
89
|
+
let ok = false;
|
|
90
|
+
for (const x of r.locales) {
|
|
91
|
+
if (res[x]) break;
|
|
92
|
+
if (whitelist.includes(x)) {
|
|
93
|
+
ok = true;
|
|
94
|
+
break;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
if (!ok) continue;
|
|
98
|
+
const b = new _fluent_bundle.FluentBundle(r.locales);
|
|
99
|
+
for (const x of r.locales) {
|
|
100
|
+
res[x] = r;
|
|
101
|
+
bun[x] = b;
|
|
102
|
+
}
|
|
103
|
+
for (const url of r.resources) {
|
|
104
|
+
let promise;
|
|
105
|
+
if (_qwik_dev_core.isServer) {
|
|
106
|
+
const rel = url.toString().slice(1);
|
|
107
|
+
const candidates = [new URL("../dist/", _rawProps.origin), _rawProps.origin].map((base) => new URL(rel, base));
|
|
108
|
+
const ata = candidates.find((c) => c.protocol === "ata:");
|
|
109
|
+
if (ata) promise = new Promise((resolve, reject) => {
|
|
110
|
+
try {
|
|
111
|
+
resolve(ataToUtf8(ata.pathname));
|
|
112
|
+
} catch (err) {
|
|
113
|
+
reject(err);
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
else promise = import("node:fs/promises").then(async (fs) => {
|
|
117
|
+
const { fileURLToPath } = await import("node:url");
|
|
118
|
+
let firstError;
|
|
119
|
+
for (const c of candidates) try {
|
|
120
|
+
const buf = await fs.readFile(c.protocol === "file:" ? fileURLToPath(c) : c.pathname);
|
|
121
|
+
return new TextDecoder().decode(buf);
|
|
122
|
+
} catch (err) {
|
|
123
|
+
if (firstError === void 0) firstError = err;
|
|
124
|
+
}
|
|
125
|
+
throw firstError;
|
|
126
|
+
});
|
|
127
|
+
} else promise = fetch(url).then((resp) => resp.text());
|
|
128
|
+
promises.push(promise.then((s) => {
|
|
129
|
+
const errset = b.addResource(new _fluent_bundle.FluentResource(s));
|
|
130
|
+
if (errset.length) {
|
|
131
|
+
errors.value.push({
|
|
132
|
+
resource: r,
|
|
133
|
+
errors: errset
|
|
134
|
+
});
|
|
135
|
+
has_errors = true;
|
|
136
|
+
console.error(`[qfluent] Errors in resource ${url}:`, errset);
|
|
137
|
+
}
|
|
138
|
+
}));
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
return Promise.all(promises).then(() => {
|
|
142
|
+
bunmap.trigger();
|
|
143
|
+
resmap.trigger();
|
|
144
|
+
if (has_errors) errors.trigger();
|
|
145
|
+
});
|
|
146
|
+
}, "FluentProvider_component_useTask_0r0LUJYLJnU", [
|
|
147
|
+
_rawProps,
|
|
148
|
+
bunmap,
|
|
149
|
+
errors,
|
|
150
|
+
locales,
|
|
151
|
+
resmap,
|
|
152
|
+
ssr
|
|
153
|
+
]));
|
|
154
|
+
(0, _qwik_dev_core.useTaskQrl)(/*#__PURE__*/ (0, _qwik_dev_core.inlinedQrl)(({ track }) => {
|
|
155
|
+
const locales = _qwik_dev_core._captures[0], resmap = _qwik_dev_core._captures[1], ssr = _qwik_dev_core._captures[2];
|
|
156
|
+
if (track(ssr)) return;
|
|
157
|
+
if (!track(resmap)) return;
|
|
158
|
+
track(locales);
|
|
159
|
+
const root = document.querySelector("html");
|
|
160
|
+
if (!root) return;
|
|
161
|
+
for (const l of locales.value) {
|
|
162
|
+
const b = resmap.value[l];
|
|
163
|
+
if (!b) continue;
|
|
164
|
+
root.lang = l;
|
|
165
|
+
const dir = b.dir;
|
|
166
|
+
if (dir) root.dir = dir;
|
|
167
|
+
else root.dir = "";
|
|
168
|
+
break;
|
|
169
|
+
}
|
|
170
|
+
}, "FluentProvider_component_useTask_1_GdWGQNUVI4g", [
|
|
171
|
+
locales,
|
|
172
|
+
resmap,
|
|
173
|
+
ssr
|
|
174
|
+
]));
|
|
175
|
+
return /*#__PURE__*/ (0, _qwik_dev_core._jsxSorted)(_qwik_dev_core.Slot, null, null, null, 3, "76_0");
|
|
187
176
|
}, "FluentProvider_component_LWfKAJ3jVqM"));
|
|
188
177
|
exports.FluentBundlesId = FluentBundlesId;
|
|
189
178
|
exports.FluentErrorsId = FluentErrorsId;
|