@object-ui/i18n 4.7.0 → 5.0.0

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 CHANGED
@@ -1,5 +1,40 @@
1
1
  # @object-ui/i18n
2
2
 
3
+ ## 5.0.0
4
+
5
+ ### Patch Changes
6
+
7
+ - 8930b15: feat(detail): close the gap between Page-assigned and default record detail pages (Track 1)
8
+
9
+ Custom Lightning-style record detail pages (assigned via `assignedPage` /
10
+ `Page` schemas) used to feel meaningfully poorer than the auto-generated
11
+ default detail view. They were missing cross-cutting affordances and
12
+ shipped with English-only tab labels and heavy bordered section cards
13
+ even when the host locale was Chinese. Track 1 closes the visible gap:
14
+ - **app-shell `RecordDetailView`**: the `assignedPage` branch now wears
15
+ the same chrome as the default branch — lifecycle managed-by badge
16
+ and presence avatars in the top-right, `MetadataPanel` debug panel,
17
+ `ActionConfirmDialog` / `ActionParamDialog`, and an auto-appended
18
+ `RecordChatterPanel` at the bottom of the page. Authors opt out of
19
+ the auto-discussion with `assignedPage.disableDiscussion = true`.
20
+ - **plugin-detail `record:details`**: defaults to `inlineEdit: true` so
21
+ fields are click-to-edit just like the default page, and synthesises
22
+ sections with `showBorder: false` by default so a Lightning page
23
+ doesn't double-wrap every block in a heavy Card.
24
+ - **components `page:tabs` / `page:accordion`**: well-known English
25
+ labels (Details / Related / Activity / History / Notes / Files /
26
+ Tasks / Events / Attachments / Chatter / Discussion / Comments /
27
+ Overview / Summary) auto-translate to Chinese (`zh-CN` / `zh-TW`)
28
+ via a built-in dictionary keyed off `document.documentElement.lang`.
29
+ Authors supplying explicit localised labels (string or
30
+ `{ default, zh-CN, ... }`) are not affected.
31
+ - **i18n provider**: applies the initial language to
32
+ `document.documentElement.lang` on mount (i18next does not fire
33
+ `languageChanged` for the bootstrap language), so locale-aware
34
+ renderers downstream see the right value from the first render.
35
+
36
+ ## 4.8.0
37
+
3
38
  ## 4.7.0
4
39
 
5
40
  ## 4.6.0
package/dist/provider.js CHANGED
@@ -33,6 +33,18 @@ export function I18nProvider({ config, instance: externalInstance, loadLanguage,
33
33
  document.documentElement.lang = lng;
34
34
  }
35
35
  };
36
+ // Apply the initial language to <html> immediately. i18next does NOT
37
+ // fire `languageChanged` for the bootstrap language, so without this
38
+ // call `document.documentElement.lang` would stay at its server-rendered
39
+ // default ('en') even though the app is rendering in another locale.
40
+ // Downstream renderers (e.g. `@object-ui/components` containers.tsx)
41
+ // rely on the <html lang=…> attribute to pick the right translation
42
+ // dictionary.
43
+ const initialLang = i18nInstance.language || language;
44
+ if (typeof document !== 'undefined' && initialLang) {
45
+ document.documentElement.dir = getDirection(initialLang);
46
+ document.documentElement.lang = initialLang;
47
+ }
36
48
  i18nInstance.on('languageChanged', handleLanguageChanged);
37
49
  return () => {
38
50
  i18nInstance.off('languageChanged', handleLanguageChanged);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@object-ui/i18n",
3
- "version": "4.7.0",
3
+ "version": "5.0.0",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "license": "MIT",