@deriv-com/translations 1.3.4 → 1.3.5

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
@@ -10,7 +10,7 @@ This is a localization library that uses `i18next`, `react-i18next`, and a custo
10
10
  - [Usage](#usage)
11
11
  - [`initializeI18n`](#initializei18n)
12
12
  - [`<Localize />`](#localize-component-example)
13
- - [~~`localize`~~](#localize-example)
13
+ - [`localize`](#localize-example)
14
14
  - [`useTranslations` Hook](#usetranslations-hook)
15
15
  - [Syncing translations to CDN](#syncing-translations)
16
16
  - [Example usage of the action in the workflow file](#example-usage-of-the-action-in-the-workflow-file)
@@ -100,16 +100,16 @@ import { Localize } from "@deriv-com/translations";
100
100
  />;
101
101
  ```
102
102
 
103
- ### ~~`localize`~~ example:
103
+ ### `localize` example:
104
104
 
105
- > Note that the `localize` function is deprecated and should be replaced with the `useTranslations` hook or the `Localize` component. this function will not get the update from i18n instance once there is any changes like resource loaded or language change. the example of the `localize` function is provided for backward compatibility.
105
+ > Note that the `localize` function will not get the update from i18n instance once there is any changes like resource loaded or language change. This `localize` function is not to be used to wrap strings in components and only suitable for util/mapper functions which would not cause issues with string not getting updated.
106
106
 
107
107
  ```jsx
108
108
  import { localize } from "@deriv-com/translations";
109
109
 
110
- <h4 className="drawer__notifications-header">
111
- {localize("all notifications")}
112
- </h4>;
110
+ const getNotification = () => ({
111
+ all: localize("all notifications"),
112
+ });
113
113
  ```
114
114
 
115
115
  ### `useTranslations` Hook
@@ -1,6 +1,4 @@
1
1
  /**
2
- * @deprecated use the `localize` function from the `useTranslations` hook, this function will not get the update from i18n instance once there is any changes like resource loaded or language changed
3
- *
4
2
  * @param {string} string
5
3
  * @param {Record<string, unknown>} values
6
4
  * @returns {string}
package/package.json CHANGED
@@ -10,7 +10,7 @@
10
10
  "deriv-extract-translations": "./dist/deriv-extract-translations.cjs"
11
11
  },
12
12
  "private": false,
13
- "version": "1.3.4",
13
+ "version": "1.3.5",
14
14
  "scripts": {
15
15
  "dev": "vite",
16
16
  "build": "tsc && vite build && cp ./src/scripts/deriv-extract-translations.cjs ./dist/deriv-extract-translations.cjs",