@proveanything/smartlinks 2.2.7 → 2.2.8

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.
@@ -1,6 +1,6 @@
1
1
  # Smartlinks API Summary
2
2
 
3
- Version: 2.2.7 | Generated: 2026-12-04T13:31:00.283Z
3
+ Version: 2.2.8 | Generated: 2026-12-04T15:02:35.781Z
4
4
 
5
5
  This is a concise summary of all available API functions and types.
6
6
 
package/dist/docs/i18n.md CHANGED
@@ -16,13 +16,17 @@ Forge's step 21 moves an app off it.
16
16
  3. **The host says which language.** Studio passes the person's own Studio language as `?lang=`, and later
17
17
  changes arrive live (`smartlinks:root-state` with `lang`). A key with no translation shows its English.
18
18
 
19
- **Where the other languages come from at run time.** Only `en.json` is in your source. The other
20
- languages are files the platform adds to the published bundle, and the SDK **downloads** the one in use
21
- (`GET <folder>/i18n/fr.json`) when the app starts or the language changes. It is a static file fetch, not
22
- an API call. `<folder>` is beside the page by default, or what you gave as `baseUrl` / `moduleUrl`. So when
23
- a key that has a translation still shows English, ask: **which `fr.json` was fetched, from where, and was it
24
- yours?** (In the browser's network list, filter on `i18n/`.) A local dev server or stand-in usually can't
25
- show this fault: there the page and the bundle are the same folder.
19
+ **Where the other languages come from at run time.** Once your app is translated, the other languages
20
+ are files beside `en.json` (`public/i18n/fr.json`, `de.json`…), in your source and in the published bundle.
21
+ They are not compiled into your code: the SDK **downloads** the one in use (`GET <folder>/i18n/fr.json`) when
22
+ the app starts or the language changes. It is a static file fetch, not an API call. `<folder>` is beside the
23
+ page by default, or what you gave as `baseUrl` / `moduleUrl`. So when a key still shows English:
24
+
25
+ 1. Look the key up in `public/i18n/<lang>.json`. Missing there: it isn't translated yet.
26
+ 2. There, but still English: the file isn't being read. Ask **which `fr.json` was fetched, from where, and
27
+ was it yours?** (In the browser's network list, filter on `i18n/`.) A local dev server or stand-in
28
+ usually can't show this fault: there the page and the bundle are the same folder. Inside Portal or Hub,
29
+ see the next section.
26
30
 
27
31
  ## Mounted inside another app's page: use `i18n.forApp`
28
32
 
@@ -54,8 +58,10 @@ export function useT() {
54
58
  instead when you know the folder exactly.
55
59
  - Don't call `i18n.init` from a container or widget: it changes the host's settings.
56
60
  - A container or widget runs on the **host's** SDK, not the one in your `package.json`. A host older than
57
- 2.2.5 has no `forApp`, and calling it there stops your whole panel. Check first and fall back to your
58
- bundled English: `typeof i18n.forApp === 'function' ? i18n.forApp(...) : <your English only>`.
61
+ 2.2.5 has no `forApp`, and one older than 2.2.1 has no `i18n` at all; calling either there stops your
62
+ whole panel. Check first and fall back to your bundled English:
63
+ `typeof i18n?.forApp === 'function' ? i18n.forApp(...) : <your English only>`, and use `i18n?.` for
64
+ anything else you read from the host's `i18n`.
59
65
  - `forApp` works for a standalone page too, so one `src/i18n.ts` can serve every way the app is shown.
60
66
 
61
67
  In an admin app, `lang` is the person's **Studio language** (buttons and labels). The site's content