langsys-js-react 0.6.3 → 0.6.5
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 +27 -0
- package/README.md +5 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,30 @@
|
|
|
1
|
+
## 0.6.5 - 2026-08-16
|
|
2
|
+
|
|
3
|
+
### Fixed (documentation)
|
|
4
|
+
|
|
5
|
+
- **`<Translate>`'s attribute-harvesting docs were wrong in two ways.** No behavior change — the SDK always did the right thing; the README under-described it. Verified against the published `langsys-js-typescript@0.6.4` bundle.
|
|
6
|
+
- **The attribute list named 4 of the 15 harvested.** Missing were `label`, four more ARIA strings (`aria-placeholder`, `aria-description`, `aria-valuetext`, `aria-roledescription`), and six `data-*` validation messages. The ARIA omissions mattered most: those strings are invisible on the page, so nobody notices they *are* translated — or would notice if they weren't.
|
|
7
|
+
- **"button/input `value`" over-promised.** `value` is translated on `<button>` and on `<input type="submit">` / `<input type="button">` — and no other input type. The exclusion is deliberate: `value` is translated where it's a *label* and left alone where it's *data*, so a text field's value is never rewritten. The old wording implied the SDK would mangle what a user typed.
|
|
8
|
+
|
|
9
|
+
The line was inherited from a shared ancestor by all three framework bindings; Svelte and Vue fixed theirs before publishing, and the Vue agent flagged that this package had shipped it.
|
|
10
|
+
|
|
11
|
+
## 0.6.4 - 2026-08-16
|
|
12
|
+
|
|
13
|
+
### Fixed
|
|
14
|
+
|
|
15
|
+
- **Base SDK bumped to `langsys-js-typescript@^0.6.4` — fixes raw ICU message source rendering to the page.** Unlike the recent bumps, this one changes what your users see. When an ICU argument was missing, the base SDK fell back to the simple `{key}` interpolator, whose pattern deliberately can't match an ICU slot — so the entire construct passed through untouched:
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
before: {name_gender, select, male {Bienvenido} female {Bienvenida} other {Bienvenide}} Sarah
|
|
19
|
+
after: Bienvenide Sarah
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
**This is reachable without any mistake on your part**, which is why it's worth upgrading for: langsys-ai's ICU promoter can *introduce* a `select` argument the source phrase never had — a plain `%name%` / `{name}` becomes `{name_gender, select, …}` in gendered target locales. Your app can't supply `name_gender`, because it doesn't exist in the phrase you wrote and nothing tells you the translation grew one. Any React app translating into a gendered locale could hit this, through either `t()` or `<Translate params>` / `<Phrase params>`.
|
|
23
|
+
|
|
24
|
+
Recovery is aligned with `langsys-php` so a shared catalog can't render two different sentences: a missing `select` argument takes the `other` branch (a correct sentence — `other` is what an unknown gender should render), and a missing `plural` argument takes `other` with `#` rendered as `{count}` (nothing can be inferred for a count, so the sentence survives with a visible gap).
|
|
25
|
+
|
|
26
|
+
- **A `null` param now counts as missing rather than coercing to `0`.** Previously `{count, plural, …}` with `count: null` rendered `0 items` — identical to a genuine `count: 0`, so a failure to pass the value and an empty cart produced the same string on screen, in screenshots, and in bug reports. A real `0` still renders `0 items`; only `null` now takes the recovery path.
|
|
27
|
+
|
|
1
28
|
## 0.6.3 - 2026-08-16
|
|
2
29
|
|
|
3
30
|
### Changed
|
package/README.md
CHANGED
|
@@ -174,7 +174,11 @@ function Article() {
|
|
|
174
174
|
```
|
|
175
175
|
|
|
176
176
|
The component:
|
|
177
|
-
- Recursively tokenizes text nodes and translatable attributes
|
|
177
|
+
- Recursively tokenizes text nodes, `<option>` text, and translatable attributes — 15 of them, not just the visible ones:
|
|
178
|
+
- **Visible text:** `placeholder`, `alt`, `title`, `label`
|
|
179
|
+
- **Screen-reader text:** `aria-label`, `aria-placeholder`, `aria-description`, `aria-valuetext`, `aria-roledescription` — worth knowing these are covered, since untranslated ARIA strings are invisible on the page and only surface to someone using a screen reader
|
|
180
|
+
- **Validation messages:** `data-error`, `data-error-message`, `data-validation-message`, `data-invalid-message`, `data-required-message`, `data-pattern-message`
|
|
181
|
+
- Translates the `value` attribute **only where it is a label rather than data**: on `<button>`, and on `<input type="submit">` / `<input type="button">`. Every other input type is left alone, so a text field's value is never rewritten. This is a separate mechanism from the attribute list above — `value` is deliberately *not* in the SDK's `TRANSLATABLE_ATTRIBUTES`; it's gated by `VALUE_TRANSLATABLE_ELEMENTS` / `VALUE_TRANSLATABLE_INPUT_TYPES`.
|
|
178
182
|
- Captures semantic CSS so translators see the styled appearance in the Translation Manager.
|
|
179
183
|
- Registers the whole thing as a **content block** that translators handle as one unit while still translating the individual phrases inside.
|
|
180
184
|
- Auto re-translates on locale change.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "langsys-js-react",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.5",
|
|
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.6.
|
|
64
|
+
"langsys-js-typescript": "^0.6.4"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
67
|
"@eslint/js": "^9.0.0",
|