@qrvey/utils 1.3.0-1 → 1.3.0-2
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/cjs/globalization/service/i18nextBuilder.d.ts +9 -0
- package/dist/cjs/globalization/service/i18nextBuilder.js +3 -0
- package/dist/globalization/service/i18nextBuilder.d.ts +9 -0
- package/dist/globalization/service/i18nextBuilder.js +3 -0
- package/package.json +10 -13
- package/scripts/generating-docs/index.js +2 -2
- package/src/globalization/service/i18nextBuilder.ts +10 -0
- package/tsconfig.doc.json +4 -0
|
@@ -5,6 +5,15 @@ export declare class I18nServiceBuilder {
|
|
|
5
5
|
private static _initI18n;
|
|
6
6
|
static setTranslations(i18nDefault: any, i18nResource: II18nResource): II18nResource;
|
|
7
7
|
}
|
|
8
|
+
/**
|
|
9
|
+
* This class allows to use the translation service of the i18next library
|
|
10
|
+
*/
|
|
8
11
|
export declare abstract class I18nService {
|
|
12
|
+
/**
|
|
13
|
+
* This method by means of the key searches in the configuration object, replaces the values received by means of the options parameter and returns the translated text. Ex: <b>translate('the_value_is {{number}}',{number: 1});</b>
|
|
14
|
+
* @param key String used as key
|
|
15
|
+
* @param options Object of type II18nServiceTranslateOption that contains the dynamic parameters to replace
|
|
16
|
+
* @returns The translated text Ex: <b>The value is: 1</b>
|
|
17
|
+
*/
|
|
9
18
|
abstract translate(key: string, options?: II18nServiceTranslateOption): string;
|
|
10
19
|
}
|
|
@@ -5,6 +5,15 @@ export declare class I18nServiceBuilder {
|
|
|
5
5
|
private static _initI18n;
|
|
6
6
|
static setTranslations(i18nDefault: any, i18nResource: II18nResource): II18nResource;
|
|
7
7
|
}
|
|
8
|
+
/**
|
|
9
|
+
* This class allows to use the translation service of the i18next library
|
|
10
|
+
*/
|
|
8
11
|
export declare abstract class I18nService {
|
|
12
|
+
/**
|
|
13
|
+
* This method by means of the key searches in the configuration object, replaces the values received by means of the options parameter and returns the translated text. Ex: <b>translate('the_value_is {{number}}',{number: 1});</b>
|
|
14
|
+
* @param key String used as key
|
|
15
|
+
* @param options Object of type II18nServiceTranslateOption that contains the dynamic parameters to replace
|
|
16
|
+
* @returns The translated text Ex: <b>The value is: 1</b>
|
|
17
|
+
*/
|
|
9
18
|
abstract translate(key: string, options?: II18nServiceTranslateOption): string;
|
|
10
19
|
}
|
|
@@ -40,6 +40,9 @@ export class I18nServiceBuilder {
|
|
|
40
40
|
return mergeDeep(i18nResource, i18nDefault, { mergeExistingValues: false });
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
|
+
/**
|
|
44
|
+
* This class allows to use the translation service of the i18next library
|
|
45
|
+
*/
|
|
43
46
|
export class I18nService {
|
|
44
47
|
}
|
|
45
48
|
class I18nServiceConcrete extends I18nService {
|
package/package.json
CHANGED
|
@@ -1,42 +1,39 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qrvey/utils",
|
|
3
|
-
"version": "1.3.0-
|
|
3
|
+
"version": "1.3.0-2",
|
|
4
4
|
"description": "Helper, Utils for all Qrvey Projects",
|
|
5
5
|
"homepage": "https://bitbucket.org/qrvey/qrvey_utils/wiki/Home",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"build": "tsc && tsc -m commonjs --outDir dist/cjs",
|
|
9
9
|
"build-clean": "node ./scripts/clean-build",
|
|
10
|
-
"
|
|
11
|
-
"
|
|
10
|
+
"compodoc": "npx compodoc -p tsconfig.doc.json",
|
|
11
|
+
"compodoc:server": "./node_modules/.bin/compodoc -p ./tsconfig.doc.json -s --port=4400",
|
|
12
12
|
"lint": "eslint src --quiet --exit-on-fatal-error --ext .ts,.js",
|
|
13
13
|
"lint-dev": "eslint src --debug --ext .ts,.tsx",
|
|
14
14
|
"publishing-old": "node ./scripts/prepare-publish && np",
|
|
15
15
|
"publishing-prerelease-old": "node ./scripts/prepare-publish && np --any-branch --tag=$npm_config_tag",
|
|
16
16
|
"publishing-beta-1": "node ./scripts/publishing --np-new-version=$npm_config_np_new_version --np-any-branch=$npm_config_np_any_branch --np-tag=$npm_config_np_tag",
|
|
17
|
-
"publishing-beta-2": "node ./scripts/clean-build && node ./scripts/generating-docs && np --any-branch --
|
|
17
|
+
"publishing-beta-2": "node ./scripts/clean-build && node ./scripts/generating-docs --np-new-version=$npm_config_np_new_version && np $npm_config_np_new_version --any-branch --tag=$npm_config_np_tag",
|
|
18
18
|
"test": "jest test",
|
|
19
19
|
"test:watch": "jest --watch test"
|
|
20
20
|
},
|
|
21
21
|
"author": "Qrvey Inc",
|
|
22
22
|
"license": "MIT",
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@types/jest": "27.4.1",
|
|
25
|
-
"@typescript-eslint/eslint-plugin": "5.22.0",
|
|
26
|
-
"@typescript-eslint/parser": "5.22.0",
|
|
27
|
-
"doxdox": "3.0.0",
|
|
28
24
|
"eslint": "8.14.0",
|
|
29
25
|
"jest": "27.5.1",
|
|
30
|
-
"jsdoc": "3.6.10",
|
|
31
26
|
"np": "7.6.1",
|
|
32
27
|
"typedoc": "0.22.15",
|
|
33
|
-
"typescript": "4.6.4"
|
|
28
|
+
"typescript": "4.6.4",
|
|
29
|
+
"@compodoc/compodoc": "1.1.19",
|
|
30
|
+
"@types/jest": "27.4.1",
|
|
31
|
+
"@typescript-eslint/eslint-plugin": "5.22.0",
|
|
32
|
+
"@typescript-eslint/parser": "5.22.0"
|
|
34
33
|
},
|
|
35
34
|
"dependencies": {
|
|
36
35
|
"d3": "6.3.1",
|
|
36
|
+
"dayjs": "1.11.1",
|
|
37
37
|
"i18next": "21.6.16"
|
|
38
|
-
},
|
|
39
|
-
"peerDependencies": {
|
|
40
|
-
"dayjs": ">=1.11.1 <1.12.0"
|
|
41
38
|
}
|
|
42
39
|
}
|
|
@@ -67,9 +67,9 @@ async function startGeneratingDocs(settings) {
|
|
|
67
67
|
await pushingChanges(settings);
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
-
async function generatingDocument(
|
|
70
|
+
async function generatingDocument(_settings) {
|
|
71
71
|
console.log('==>>> Generating Document...');
|
|
72
|
-
await execute(
|
|
72
|
+
await execute('npm run compodoc');
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
async function changingVersion(settings) {
|
|
@@ -35,7 +35,17 @@ export class I18nServiceBuilder {
|
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
+
/**
|
|
39
|
+
* This class allows to use the translation service of the i18next library
|
|
40
|
+
*/
|
|
38
41
|
export abstract class I18nService {
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* This method by means of the key searches in the configuration object, replaces the values received by means of the options parameter and returns the translated text. Ex: <b>translate('the_value_is {{number}}',{number: 1});</b>
|
|
45
|
+
* @param key String used as key
|
|
46
|
+
* @param options Object of type II18nServiceTranslateOption that contains the dynamic parameters to replace
|
|
47
|
+
* @returns The translated text Ex: <b>The value is: 1</b>
|
|
48
|
+
*/
|
|
39
49
|
abstract translate(key: string, options?: II18nServiceTranslateOption): string;
|
|
40
50
|
}
|
|
41
51
|
|