@sap-ux/inquirer-common 0.4.7 → 0.4.9
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 +5 -0
- package/dist/i18n.js +9 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3 -0
- package/package.json +2 -2
package/dist/i18n.d.ts
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import type { TOptions } from 'i18next';
|
|
2
|
+
/**
|
|
3
|
+
* Adds the `inquirer-common` resource bundle to i18next.
|
|
4
|
+
* May be required to load i18n translations after initialising in the consumer module.
|
|
5
|
+
*/
|
|
6
|
+
export declare function addi18nResourceBundle(): void;
|
|
2
7
|
/**
|
|
3
8
|
* Initialize i18next with the translations for this module.
|
|
4
9
|
*/
|
package/dist/i18n.js
CHANGED
|
@@ -3,16 +3,24 @@ 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.addi18nResourceBundle = addi18nResourceBundle;
|
|
6
7
|
exports.initI18nInquirerCommon = initI18nInquirerCommon;
|
|
7
8
|
exports.t = t;
|
|
8
9
|
const i18next_1 = __importDefault(require("i18next"));
|
|
9
10
|
const inquirer_common_i18n_json_1 = __importDefault(require("./translations/inquirer-common.i18n.json"));
|
|
10
11
|
const inquirerCommonI18nNamespace = 'inquirer-common';
|
|
12
|
+
/**
|
|
13
|
+
* Adds the `inquirer-common` resource bundle to i18next.
|
|
14
|
+
* May be required to load i18n translations after initialising in the consumer module.
|
|
15
|
+
*/
|
|
16
|
+
function addi18nResourceBundle() {
|
|
17
|
+
i18next_1.default.addResourceBundle('en', inquirerCommonI18nNamespace, inquirer_common_i18n_json_1.default);
|
|
18
|
+
}
|
|
11
19
|
/**
|
|
12
20
|
* Initialize i18next with the translations for this module.
|
|
13
21
|
*/
|
|
14
22
|
async function initI18nInquirerCommon() {
|
|
15
|
-
await i18next_1.default.init({ lng: 'en', fallbackLng: 'en' }, () =>
|
|
23
|
+
await i18next_1.default.init({ lng: 'en', fallbackLng: 'en' }, () => addi18nResourceBundle());
|
|
16
24
|
}
|
|
17
25
|
/**
|
|
18
26
|
* Helper function facading the call to i18next. Unless a namespace option is provided the local namespace will be used.
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -14,7 +14,10 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.addi18nResourceBundle = void 0;
|
|
17
18
|
__exportStar(require("./prompts/utility"), exports);
|
|
18
19
|
__exportStar(require("./types"), exports);
|
|
19
20
|
__exportStar(require("./prompts/helpers"), exports);
|
|
21
|
+
var i18n_1 = require("./i18n");
|
|
22
|
+
Object.defineProperty(exports, "addi18nResourceBundle", { enumerable: true, get: function () { return i18n_1.addi18nResourceBundle; } });
|
|
20
23
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sap-ux/inquirer-common",
|
|
3
3
|
"description": "Commonly used shared functionality and types to support inquirer modules.",
|
|
4
|
-
"version": "0.4.
|
|
4
|
+
"version": "0.4.9",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/SAP/open-ux-tools.git",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"figures": "3.2.0",
|
|
26
26
|
"semver": "7.5.4",
|
|
27
27
|
"lodash": "4.17.21",
|
|
28
|
-
"@sap-ux/ui5-info": "0.8.
|
|
28
|
+
"@sap-ux/ui5-info": "0.8.2"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@sap-devx/yeoman-ui-types": "1.14.4",
|