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 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 { i18n as i18nAgentUI } from 'cobrowse-agent-ui';
14
+ import { bindI18n } from 'cobrowse-agent-ui';
15
15
 
16
16
  i18n.init({
17
17
  // ...
18
18
  });
19
19
 
20
- i18n.on('languageChanged', (language) => {
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-parser.config.js`.
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.js` and add it to the `resources` object (in the i18n instance
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.js`.
36
- - Add a new entry to the `SUPPORTED_LOCALES` constant inside `lib/i18n.js`.
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.