@sap-ux/project-input-validator 0.6.9 → 0.6.11
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/i18n.d.ts +2 -1
- package/dist/i18n.js +8 -4
- package/package.json +3 -4
package/dist/i18n.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type { TOptions } from 'i18next';
|
|
1
|
+
import type { i18n as i18nNext, TOptions } from 'i18next';
|
|
2
2
|
export declare const PROJECT_INPUT_VALIDATOR_NS = "project-input-validator";
|
|
3
|
+
export declare const i18n: i18nNext;
|
|
3
4
|
/**
|
|
4
5
|
* Adds the `project-input-validator` resource bundle to i18next.
|
|
5
6
|
* May be required to load i18n translations after initialising in the consumer module.
|
package/dist/i18n.js
CHANGED
|
@@ -3,25 +3,29 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.PROJECT_INPUT_VALIDATOR_NS = void 0;
|
|
6
|
+
exports.i18n = exports.PROJECT_INPUT_VALIDATOR_NS = void 0;
|
|
7
7
|
exports.addi18nResourceBundle = addi18nResourceBundle;
|
|
8
8
|
exports.initI18nProjectValidators = initI18nProjectValidators;
|
|
9
9
|
exports.t = t;
|
|
10
10
|
const i18next_1 = __importDefault(require("i18next"));
|
|
11
11
|
const project_input_validator_i18n_json_1 = __importDefault(require("./translations/project-input-validator.i18n.json"));
|
|
12
12
|
exports.PROJECT_INPUT_VALIDATOR_NS = 'project-input-validator';
|
|
13
|
+
exports.i18n = i18next_1.default.createInstance();
|
|
13
14
|
/**
|
|
14
15
|
* Adds the `project-input-validator` resource bundle to i18next.
|
|
15
16
|
* May be required to load i18n translations after initialising in the consumer module.
|
|
16
17
|
*/
|
|
17
18
|
function addi18nResourceBundle() {
|
|
18
|
-
|
|
19
|
+
exports.i18n.addResourceBundle('en', exports.PROJECT_INPUT_VALIDATOR_NS, project_input_validator_i18n_json_1.default);
|
|
19
20
|
}
|
|
20
21
|
/**
|
|
21
22
|
* Initialize i18next with the translations for this module.
|
|
22
23
|
*/
|
|
23
24
|
async function initI18nProjectValidators() {
|
|
24
|
-
await
|
|
25
|
+
await exports.i18n.init({
|
|
26
|
+
lng: 'en',
|
|
27
|
+
fallbackLng: 'en'
|
|
28
|
+
});
|
|
25
29
|
addi18nResourceBundle();
|
|
26
30
|
}
|
|
27
31
|
/**
|
|
@@ -35,7 +39,7 @@ function t(key, options) {
|
|
|
35
39
|
if (!options?.ns) {
|
|
36
40
|
options = Object.assign(options ?? {}, { ns: exports.PROJECT_INPUT_VALIDATOR_NS });
|
|
37
41
|
}
|
|
38
|
-
return
|
|
42
|
+
return exports.i18n.t(key, options);
|
|
39
43
|
}
|
|
40
44
|
initI18nProjectValidators().catch(() => {
|
|
41
45
|
// needed by lint
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sap-ux/project-input-validator",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.11",
|
|
4
4
|
"description": "Library to validate Fiori project input formats",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -14,13 +14,12 @@
|
|
|
14
14
|
"private": false,
|
|
15
15
|
"main": "dist/index.js",
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"i18next": "
|
|
17
|
+
"i18next": "25.3.0",
|
|
18
18
|
"validate-npm-package-name": "5.0.0",
|
|
19
|
-
"@sap-ux/project-access": "1.30.
|
|
19
|
+
"@sap-ux/project-access": "1.30.7"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"@types/validate-npm-package-name": "4.0.1",
|
|
23
|
-
"@types/i18next": "13.0.0",
|
|
24
23
|
"jest-extended": "4.0.2"
|
|
25
24
|
},
|
|
26
25
|
"files": [
|