@stacksjs/stx 0.2.40 → 0.2.42

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.
@@ -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 string for
25
- * the given locale. The key syntax sidesteps stx's `{{ ... }}`
26
- * templating (which evaluates as JS at build time and would render
27
- * `t(...)` calls as empty when no `t` binding exists in scope).
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
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/stx",
3
3
  "type": "module",
4
- "version": "0.2.40",
4
+ "version": "0.2.42",
5
5
  "description": "A performant UI Framework. Powered by Bun.",
6
6
  "author": "Chris Breuer <chris@stacksjs.org>",
7
7
  "license": "MIT",
@@ -119,7 +119,7 @@
119
119
  "@stacksjs/desktop": "0.2.35",
120
120
  "@stacksjs/sanitizer": "0.2.35",
121
121
  "@stacksjs/ts-craft": "^0.0.2",
122
- "bun-plugin-stx": "0.2.35",
122
+ "bun-plugin-stx": "0.2.42",
123
123
  "bunfig": "^0.15.6",
124
124
  "stx-router": "0.2.38",
125
125
  "ts-broadcasting": "^0.0.4",