@object-ui/i18n 4.8.0 → 5.0.1
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 +35 -0
- package/dist/provider.js +12 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,40 @@
|
|
|
1
1
|
# @object-ui/i18n
|
|
2
2
|
|
|
3
|
+
## 5.0.1
|
|
4
|
+
|
|
5
|
+
## 5.0.0
|
|
6
|
+
|
|
7
|
+
### Patch Changes
|
|
8
|
+
|
|
9
|
+
- 8930b15: feat(detail): close the gap between Page-assigned and default record detail pages (Track 1)
|
|
10
|
+
|
|
11
|
+
Custom Lightning-style record detail pages (assigned via `assignedPage` /
|
|
12
|
+
`Page` schemas) used to feel meaningfully poorer than the auto-generated
|
|
13
|
+
default detail view. They were missing cross-cutting affordances and
|
|
14
|
+
shipped with English-only tab labels and heavy bordered section cards
|
|
15
|
+
even when the host locale was Chinese. Track 1 closes the visible gap:
|
|
16
|
+
- **app-shell `RecordDetailView`**: the `assignedPage` branch now wears
|
|
17
|
+
the same chrome as the default branch — lifecycle managed-by badge
|
|
18
|
+
and presence avatars in the top-right, `MetadataPanel` debug panel,
|
|
19
|
+
`ActionConfirmDialog` / `ActionParamDialog`, and an auto-appended
|
|
20
|
+
`RecordChatterPanel` at the bottom of the page. Authors opt out of
|
|
21
|
+
the auto-discussion with `assignedPage.disableDiscussion = true`.
|
|
22
|
+
- **plugin-detail `record:details`**: defaults to `inlineEdit: true` so
|
|
23
|
+
fields are click-to-edit just like the default page, and synthesises
|
|
24
|
+
sections with `showBorder: false` by default so a Lightning page
|
|
25
|
+
doesn't double-wrap every block in a heavy Card.
|
|
26
|
+
- **components `page:tabs` / `page:accordion`**: well-known English
|
|
27
|
+
labels (Details / Related / Activity / History / Notes / Files /
|
|
28
|
+
Tasks / Events / Attachments / Chatter / Discussion / Comments /
|
|
29
|
+
Overview / Summary) auto-translate to Chinese (`zh-CN` / `zh-TW`)
|
|
30
|
+
via a built-in dictionary keyed off `document.documentElement.lang`.
|
|
31
|
+
Authors supplying explicit localised labels (string or
|
|
32
|
+
`{ default, zh-CN, ... }`) are not affected.
|
|
33
|
+
- **i18n provider**: applies the initial language to
|
|
34
|
+
`document.documentElement.lang` on mount (i18next does not fire
|
|
35
|
+
`languageChanged` for the bootstrap language), so locale-aware
|
|
36
|
+
renderers downstream see the right value from the first render.
|
|
37
|
+
|
|
3
38
|
## 4.8.0
|
|
4
39
|
|
|
5
40
|
## 4.7.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);
|