langsys-js-react 0.4.1 → 0.4.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/CHANGELOG.md +6 -0
- package/README.md +2 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
## 0.4.2 - 2026-07-08
|
|
2
|
+
|
|
3
|
+
### Changed
|
|
4
|
+
|
|
5
|
+
- **Base SDK bumped to `langsys-js-typescript@^0.4.2`** — adds a debug-mode diagnostic that catches a mistaken bare `{key}` in `<Translate>`/`<Phrase>` JSX markup: if `params` keys match no placeholder in the captured content, the SDK warns and names the fix (`write %count% instead`). Silent in production, treats ICU slots as legitimate, and only re-warns when the param key-set changes. Documented in the README `%key%` guidance. No wrapper code change — the components inherit it through the base SDK.
|
|
6
|
+
|
|
1
7
|
## 0.4.1 - 2026-07-08
|
|
2
8
|
|
|
3
9
|
### Changed
|
package/README.md
CHANGED
|
@@ -198,6 +198,8 @@ The component:
|
|
|
198
198
|
|
|
199
199
|
> **Use `%key%` in `<Translate>`/`<Phrase>` markup, not bare `{key}`.** In JSX a literal `{count}` is a JavaScript expression that React evaluates *before* the SDK's DOM walker sees the text — the braces vanish and interpolation silently breaks (it still looks fine in the base locale, which hides it). `%count%` passes through JSX as plain text; the SDK normalizes it to canonical `{count}` at capture, so **translators and the catalog only ever see `{count}`**, and both spellings hash to the same content-block id. Keys are identifier-shaped (`%[A-Za-z_][A-Za-z0-9_]*%`), so a stray `%` in prose ("50% off") is left untouched. An unknown `%key%` with no matching param renders as `{key}` — matching `t()`'s behavior for unknown keys. (`t()` and the hooks keep `{key}`: JS strings reach the SDK literally, so there's no collision.)
|
|
200
200
|
|
|
201
|
+
> Since base SDK 0.4.2, running with `debug: true` catches this mistake for you: if you pass `params` whose keys match no placeholder in the captured content, the SDK warns and names the fix (`… received params with no matching placeholder … write %count% instead`). It's silent in production, treats ICU slots as legitimate, and only re-warns when the set of param keys changes.
|
|
202
|
+
|
|
201
203
|
`<Translate>` props: `category?`, `custom_id?`, `label?`, `params?`, `tag?` (defaults to `translate`), `className?`, `children`.
|
|
202
204
|
|
|
203
205
|
### `<Phrase>` — markup-bearing phrases (pluralization)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "langsys-js-react",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.2",
|
|
4
4
|
"description": "React binding for the Langsys translation SDK — realtime continuous translations with automatic token discovery, delivered as hooks and a <Translate> component.",
|
|
5
5
|
"author": "Langsys",
|
|
6
6
|
"license": "MIT",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"react": "^18.0.0 || ^19.0.0"
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
|
-
"langsys-js-typescript": "^0.4.
|
|
64
|
+
"langsys-js-typescript": "^0.4.2"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
67
|
"@eslint/js": "^9.0.0",
|