@stacksjs/stx 0.2.41 → 0.2.43
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/cli.js +420 -415
- package/dist/index.js +539 -534
- package/dist/pwa.js +218 -213
- package/dist/site-builder/i18n.d.ts +15 -4
- package/dist/ssg.js +235 -230
- package/package.json +2 -2
|
@@ -21,10 +21,21 @@ export declare function resolveI18n(site: SiteConfig, projectRoot?: string): Res
|
|
|
21
21
|
*/
|
|
22
22
|
export declare function translate(i18n: ResolvedI18n, locale: string, key: string): string;
|
|
23
23
|
/**
|
|
24
|
-
* Replace `{t:key}` markers in HTML with the translated
|
|
25
|
-
* the given locale. The key syntax sidesteps stx's
|
|
26
|
-
* templating (which evaluates as JS at build time and
|
|
27
|
-
* `t(...)` calls as empty when no `t` binding exists
|
|
24
|
+
* Replace `{t:key}` and `{t!:key}` markers in HTML with the translated
|
|
25
|
+
* string for the given locale. The key syntax sidesteps stx's
|
|
26
|
+
* `{{ ... }}` templating (which evaluates as JS at build time and
|
|
27
|
+
* would render `t(...)` calls as empty when no `t` binding exists
|
|
28
|
+
* in scope).
|
|
29
|
+
*
|
|
30
|
+
* Two variants:
|
|
31
|
+
* - `{t:key}` — value is HTML-escaped before substitution. Default
|
|
32
|
+
* for ordinary text. Safe for any translator-supplied string.
|
|
33
|
+
* - `{t!:key}` — value is substituted *raw*, without escaping. Use
|
|
34
|
+
* this when the translation needs inline markup (e.g. `<strong>`,
|
|
35
|
+
* `<a>`, `<br>`) so different languages can place emphasis where
|
|
36
|
+
* their grammar requires. Translation values for these keys live
|
|
37
|
+
* in the project's own translation files, so the trust boundary
|
|
38
|
+
* is the same as the page template itself.
|
|
28
39
|
*
|
|
29
40
|
* Keys may use letters, digits, `_`, `.`, `-`. Anything that doesn't
|
|
30
41
|
* match the pattern is left alone — runs after stx has finished its
|