cobrowse-agent-ui 1.5.0 → 1.7.0-rc.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/README.md +6 -8
- package/dist/Loader-CAqAg5k6.js +2388 -0
- package/dist/Loader-CAqAg5k6.js.map +1 -0
- package/dist/cobrowse-agent-ui.css +2 -1
- package/dist/cobrowse-agent-ui.d.ts +223 -12
- package/dist/cobrowse-agent-ui.js +656 -146
- package/dist/cobrowse-agent-ui.js.map +1 -1
- package/dist/integrations.d.ts +5 -10
- package/dist/integrations.js +113 -136
- package/dist/integrations.js.map +1 -1
- package/dist/session/demo-session.html +111 -0
- package/package.json +5 -4
- package/dist/index-BmaoQ4Rn.js +0 -1041
- package/dist/index-BmaoQ4Rn.js.map +0 -1
package/README.md
CHANGED
|
@@ -11,15 +11,13 @@ achieve this from an app that's also using `i18next` to handle localization.
|
|
|
11
11
|
// i18n.js
|
|
12
12
|
|
|
13
13
|
import i18n from 'i18next';
|
|
14
|
-
import {
|
|
14
|
+
import { bindI18n } from 'cobrowse-agent-ui';
|
|
15
15
|
|
|
16
16
|
i18n.init({
|
|
17
17
|
// ...
|
|
18
18
|
});
|
|
19
19
|
|
|
20
|
-
i18n
|
|
21
|
-
i18nAgentUI.changeLanguage(language);
|
|
22
|
-
});
|
|
20
|
+
bindI18n(i18n);
|
|
23
21
|
|
|
24
22
|
export default i18n;
|
|
25
23
|
```
|
|
@@ -28,12 +26,12 @@ export default i18n;
|
|
|
28
26
|
|
|
29
27
|
To add a new locale follow these steps:
|
|
30
28
|
|
|
31
|
-
- Add a new entry to the `locales` array inside `i18next
|
|
29
|
+
- Add a new entry to the `locales` array inside `i18next.config.ts`.
|
|
32
30
|
- Run the `npm run i18n` command to generate a new locale file.
|
|
33
|
-
- Import the new locale JSON file inside `lib/i18n.
|
|
31
|
+
- Import the new locale JSON file inside `lib/i18n/instance.ts` and add it to the `resources` object (in the i18n instance
|
|
34
32
|
configuration) keyed by the locale key.
|
|
35
|
-
- Import the relevant `date-fns` locale inside `lib/i18n.
|
|
36
|
-
- Add a new entry to
|
|
33
|
+
- Import the relevant `date-fns` locale inside `lib/i18n/instance.ts`.
|
|
34
|
+
- Add a new entry to `dateLocales` inside `lib/i18n/instance.ts`.
|
|
37
35
|
|
|
38
36
|
**Note:** ensure the locale code matches the ones provided by the
|
|
39
37
|
[date-fns library](https://github.com/date-fns/date-fns/tree/main/src/locale) as these are used to localize dates as well.
|