i18n-keyless-react 1.7.3 → 1.7.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/dist/I18nKeylessText.d.ts +23 -2
- package/dist/index.d.ts +1 -0
- package/dist/package.json +1 -1
- package/package.json +1 -1
|
@@ -1,11 +1,32 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { TranslationOptions } from "i18n-keyless-core";
|
|
3
|
-
interface I18nKeylessTextProps {
|
|
3
|
+
export interface I18nKeylessTextProps {
|
|
4
|
+
/**
|
|
5
|
+
* children must be a string
|
|
6
|
+
* it's the text to translate from your primary language
|
|
7
|
+
*/
|
|
4
8
|
children: string;
|
|
9
|
+
/**
|
|
10
|
+
* the keys to replace in the text
|
|
11
|
+
* it's an object where the key is the placeholder and the value is the replacement
|
|
12
|
+
* example: { "{{name}}": "John" } will replace all the {{name}} in the text with "John"
|
|
13
|
+
* RegEx is `key.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"))` so you can use use your own syntax
|
|
14
|
+
*/
|
|
5
15
|
replace?: Record<string, string>;
|
|
16
|
+
/**
|
|
17
|
+
* the context of the translation
|
|
18
|
+
* it's useful for ambiguous translations, like "8 heures" in French could be "8 AM" or "8 hours"
|
|
19
|
+
*/
|
|
6
20
|
context?: string;
|
|
21
|
+
/**
|
|
22
|
+
* if true, some helpful logs will be displayed in the console
|
|
23
|
+
*/
|
|
7
24
|
debug?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* if true, the translation will be saved as temporary
|
|
27
|
+
* it's useful if you want to use the translation in a different context
|
|
28
|
+
* you can leave it there forever, or remove it once your translation is saved
|
|
29
|
+
*/
|
|
8
30
|
forceTemporary?: TranslationOptions["forceTemporary"];
|
|
9
31
|
}
|
|
10
32
|
export declare const I18nKeylessText: React.FC<I18nKeylessTextProps>;
|
|
11
|
-
export {};
|
package/dist/index.d.ts
CHANGED
package/dist/package.json
CHANGED