@twin.org/merge-locales 0.0.1-next.1 → 0.0.1-next.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/index.cjs +183 -0
- package/dist/esm/index.mjs +1 -1
- package/dist/locales/en.json +243 -39
- package/docs/changelog.md +1 -1
- package/package.json +3 -5
- /package/docs/reference/{globals.md → index.md} +0 -0
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var path = require('node:path');
|
|
4
|
+
var node_url = require('node:url');
|
|
5
|
+
var cliCore = require('@twin.org/cli-core');
|
|
6
|
+
var promises = require('node:fs/promises');
|
|
7
|
+
var core = require('@twin.org/core');
|
|
8
|
+
|
|
9
|
+
var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
|
|
10
|
+
// Copyright 2024 IOTA Stiftung.
|
|
11
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
12
|
+
/**
|
|
13
|
+
* Build the root command to be consumed by the CLI.
|
|
14
|
+
* @param program The command to build on.
|
|
15
|
+
*/
|
|
16
|
+
function buildCommandMergeLocales(program) {
|
|
17
|
+
program
|
|
18
|
+
.option(core.I18n.formatMessage("commands.merge-locales.options.config.param"), core.I18n.formatMessage("commands.merge-locales.options.config.description"))
|
|
19
|
+
.action(async (opts) => {
|
|
20
|
+
await actionCommandMergeLocales(opts);
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Action the root command.
|
|
25
|
+
* @param opts The options for the command.
|
|
26
|
+
* @param opts.config The optional configuration file.
|
|
27
|
+
*/
|
|
28
|
+
async function actionCommandMergeLocales(opts) {
|
|
29
|
+
let config;
|
|
30
|
+
if (core.Is.stringValue(opts.config)) {
|
|
31
|
+
try {
|
|
32
|
+
const configJson = path.resolve(opts.config);
|
|
33
|
+
cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.merge-locales.labels.configJson"), configJson);
|
|
34
|
+
cliCore.CLIDisplay.break();
|
|
35
|
+
cliCore.CLIDisplay.task(core.I18n.formatMessage("commands.merge-locales.progress.loadingConfigJson"));
|
|
36
|
+
cliCore.CLIDisplay.break();
|
|
37
|
+
config = await cliCore.CLIUtils.readJsonFile(configJson);
|
|
38
|
+
cliCore.CLIDisplay.break();
|
|
39
|
+
}
|
|
40
|
+
catch (err) {
|
|
41
|
+
throw new core.GeneralError("commands", "commands.merge-locales.configFailed", undefined, err);
|
|
42
|
+
}
|
|
43
|
+
if (core.Is.empty(config)) {
|
|
44
|
+
throw new core.GeneralError("commands", "commands.merge-locales.configFailed");
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
await mergeLocales(process.cwd(), config ?? {});
|
|
48
|
+
cliCore.CLIDisplay.done();
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Merge the locales.
|
|
52
|
+
* @param workingDirectory The folder the app was run from.
|
|
53
|
+
* @param config The configuration for the app.
|
|
54
|
+
*/
|
|
55
|
+
async function mergeLocales(workingDirectory, config) {
|
|
56
|
+
cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.merge-locales.labels.workingDirectory"), workingDirectory);
|
|
57
|
+
const outputDirectory = path.resolve(config.outputDirectory ?? "./dist/locales");
|
|
58
|
+
const locales = config.locales ?? [];
|
|
59
|
+
const includePackages = config.includePackages ?? [];
|
|
60
|
+
const excludePackages = config.excludePackages ?? [];
|
|
61
|
+
if (locales.length === 0) {
|
|
62
|
+
locales.push({ label: "English", code: "en" });
|
|
63
|
+
}
|
|
64
|
+
cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.merge-locales.labels.outputDirectory"), outputDirectory);
|
|
65
|
+
const npmRoot = await cliCore.CLIUtils.findNpmRoot(workingDirectory);
|
|
66
|
+
cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.merge-locales.labels.npmRoot"), npmRoot);
|
|
67
|
+
cliCore.CLIDisplay.break();
|
|
68
|
+
cliCore.CLIDisplay.task(core.I18n.formatMessage("commands.merge-locales.progress.creatingOutputDirectory"), outputDirectory);
|
|
69
|
+
try {
|
|
70
|
+
await promises.rm(outputDirectory, { recursive: true });
|
|
71
|
+
}
|
|
72
|
+
catch { }
|
|
73
|
+
await promises.mkdir(outputDirectory, { recursive: true });
|
|
74
|
+
let packageNames = [];
|
|
75
|
+
const packageJson = await findDependencies(npmRoot, path.join(workingDirectory, "package.json"), packageNames);
|
|
76
|
+
excludePackages.push("@twin.org/merge-locales");
|
|
77
|
+
excludePackages.push("@twin.org/nameof");
|
|
78
|
+
excludePackages.push("@twin.org/nameof-transformer");
|
|
79
|
+
packageNames = packageNames.filter(pkg => !excludePackages.includes(pkg));
|
|
80
|
+
packageNames.push(...includePackages);
|
|
81
|
+
cliCore.CLIDisplay.break();
|
|
82
|
+
cliCore.CLIDisplay.section(core.I18n.formatMessage("commands.merge-locales.labels.sourcePackages"));
|
|
83
|
+
for (const packageName of packageNames) {
|
|
84
|
+
cliCore.CLIDisplay.value("", packageName, 1);
|
|
85
|
+
}
|
|
86
|
+
cliCore.CLIDisplay.break();
|
|
87
|
+
const localeDictionaries = {};
|
|
88
|
+
if (core.Is.stringValue(packageJson.name)) {
|
|
89
|
+
await mergePackageLocales(path.join(workingDirectory, "locales"), packageJson.name, locales, localeDictionaries);
|
|
90
|
+
}
|
|
91
|
+
for (const packageName of packageNames) {
|
|
92
|
+
const packageLocalDirectory = path.join(npmRoot, packageName, "locales");
|
|
93
|
+
await mergePackageLocales(packageLocalDirectory, packageName, locales, localeDictionaries);
|
|
94
|
+
}
|
|
95
|
+
cliCore.CLIDisplay.break();
|
|
96
|
+
cliCore.CLIDisplay.task(core.I18n.formatMessage("commands.merge-locales.progress.writingMergedLocales"));
|
|
97
|
+
for (const localeDictionary in localeDictionaries) {
|
|
98
|
+
const localeFile = path.join(outputDirectory, `${localeDictionary}.json`);
|
|
99
|
+
cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.merge-locales.labels.writingLocale"), localeFile, 1);
|
|
100
|
+
await promises.writeFile(localeFile, JSON.stringify(localeDictionaries[localeDictionary], null, 2), "utf8");
|
|
101
|
+
}
|
|
102
|
+
cliCore.CLIDisplay.break();
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Merge the locales for a package.
|
|
106
|
+
* @param packageLocalDirectory The root of the NPM packages.
|
|
107
|
+
* @param packageName The name of the package.
|
|
108
|
+
* @param locales The locales to merge.
|
|
109
|
+
* @internal
|
|
110
|
+
*/
|
|
111
|
+
async function mergePackageLocales(packageLocalDirectory, packageName, locales, localeDictionaries) {
|
|
112
|
+
cliCore.CLIDisplay.task(core.I18n.formatMessage("commands.merge-locales.progress.mergingLocalesForPackage"), packageName);
|
|
113
|
+
if (await cliCore.CLIUtils.dirExists(packageLocalDirectory)) {
|
|
114
|
+
for (const locale of locales) {
|
|
115
|
+
const localeFile = path.join(packageLocalDirectory, `${locale.code}.json`);
|
|
116
|
+
if (await cliCore.CLIUtils.dirExists(localeFile)) {
|
|
117
|
+
cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.merge-locales.labels.mergingLocale"), locale.code, 1);
|
|
118
|
+
const localeDictionary = await cliCore.CLIUtils.readJsonFile(localeFile);
|
|
119
|
+
if (!localeDictionaries[locale.code]) {
|
|
120
|
+
localeDictionaries[locale.code] = {};
|
|
121
|
+
}
|
|
122
|
+
localeDictionaries[locale.code] = core.ObjectHelper.merge(localeDictionaries[locale.code], localeDictionary);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
cliCore.CLIDisplay.break();
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Find dependencies for the package.
|
|
130
|
+
* @param npmRoot The root of the NPM packages.
|
|
131
|
+
* @param packageJsonPath The path to the package.json.
|
|
132
|
+
* @param packageNames The package names to add to.
|
|
133
|
+
* @returns The package details.
|
|
134
|
+
* @internal
|
|
135
|
+
*/
|
|
136
|
+
async function findDependencies(npmRoot, packageJsonPath, packageNames) {
|
|
137
|
+
const packageJson = await cliCore.CLIUtils.readJsonFile(packageJsonPath);
|
|
138
|
+
if (core.Is.objectValue(packageJson?.dependencies)) {
|
|
139
|
+
for (const pkg in packageJson.dependencies) {
|
|
140
|
+
if (pkg.startsWith("@twin.org") && !packageNames.includes(pkg)) {
|
|
141
|
+
packageNames.push(pkg);
|
|
142
|
+
const packagePath = path.join(npmRoot, pkg, "package.json");
|
|
143
|
+
await findDependencies(npmRoot, packagePath, packageNames);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
return packageJson ?? {};
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
// Copyright 2024 IOTA Stiftung.
|
|
151
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
152
|
+
/**
|
|
153
|
+
* The main entry point for the CLI.
|
|
154
|
+
*/
|
|
155
|
+
class CLI extends cliCore.CLIBase {
|
|
156
|
+
/**
|
|
157
|
+
* Run the app.
|
|
158
|
+
* @param argv The process arguments.
|
|
159
|
+
* @param localesDirectory The directory for the locales, default to relative to the script.
|
|
160
|
+
* @returns The exit code.
|
|
161
|
+
*/
|
|
162
|
+
async run(argv, localesDirectory) {
|
|
163
|
+
return this.execute({
|
|
164
|
+
title: "TWIN Merge Locales",
|
|
165
|
+
appName: "merge-locales",
|
|
166
|
+
version: "0.0.1-next.2",
|
|
167
|
+
icon: "⚙️ ",
|
|
168
|
+
supportsEnvFiles: false
|
|
169
|
+
}, localesDirectory ?? path.join(path.dirname(node_url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href)))), "../locales"), argv);
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Configure any options or actions at the root program level.
|
|
173
|
+
* @param program The root program command.
|
|
174
|
+
*/
|
|
175
|
+
configureRoot(program) {
|
|
176
|
+
buildCommandMergeLocales(program);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
exports.CLI = CLI;
|
|
181
|
+
exports.actionCommandMergeLocales = actionCommandMergeLocales;
|
|
182
|
+
exports.buildCommandMergeLocales = buildCommandMergeLocales;
|
|
183
|
+
exports.mergeLocales = mergeLocales;
|
package/dist/esm/index.mjs
CHANGED
|
@@ -160,7 +160,7 @@ class CLI extends CLIBase {
|
|
|
160
160
|
return this.execute({
|
|
161
161
|
title: "TWIN Merge Locales",
|
|
162
162
|
appName: "merge-locales",
|
|
163
|
-
version: "0.0.1-next.
|
|
163
|
+
version: "0.0.1-next.2",
|
|
164
164
|
icon: "⚙️ ",
|
|
165
165
|
supportsEnvFiles: false
|
|
166
166
|
}, localesDirectory ?? path.join(path.dirname(fileURLToPath(import.meta.url)), "../locales"), argv);
|
package/dist/locales/en.json
CHANGED
|
@@ -1,40 +1,244 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
2
|
+
"error": {
|
|
3
|
+
"commands": {
|
|
4
|
+
"merge-locales": {
|
|
5
|
+
"configFailed": "Configuration failed to load."
|
|
6
|
+
},
|
|
7
|
+
"common": {
|
|
8
|
+
"missingEnv": "The \"{option}\" option is configured as an environment variable, but there is no environment variable with the name \"{value}\" set.",
|
|
9
|
+
"optionInvalidHex": "The \"{option}\" does not appear to be hex. \"{value}\"",
|
|
10
|
+
"optionInvalidBase64": "The \"{option}\" does not appear to be base64. \"{value}\"",
|
|
11
|
+
"optionInvalidHexBase64": "The \"{option}\" does not appear to be hex or base64. \"{value}\"",
|
|
12
|
+
"optionInvalidBech32": "The \"{option}\" does not appear to be bech32. \"{value}\"",
|
|
13
|
+
"optionMinValue": "The \"{option}\" option must be greater than or equal to {minValue}, it is {value}.",
|
|
14
|
+
"optionMaxValue": "The \"{option}\" option must be less than or equal to {maxValue}, it is {value}."
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"validation": {
|
|
18
|
+
"beEmpty": "{fieldName} must be empty",
|
|
19
|
+
"beNotEmpty": "{fieldName} must not be empty",
|
|
20
|
+
"beText": "{fieldName} must be text",
|
|
21
|
+
"beTextValue": "{fieldName} must contain some text",
|
|
22
|
+
"beTextMinMax": "{fieldName} must be longer than {minLength} and shorter than {maxLength} characters",
|
|
23
|
+
"beTextMin": "{fieldName} must be longer than {minLength} characters",
|
|
24
|
+
"beTextMax": "{fieldName} must be shorter than {maxLength} characters",
|
|
25
|
+
"beNumber": "{fieldName} must be a number",
|
|
26
|
+
"beNumberMinMax": "{fieldName} must be >= {minValue} and <= {maxValue}",
|
|
27
|
+
"beNumberMin": "{fieldName} must be >= {minValue}",
|
|
28
|
+
"beNumberMax": "{fieldName} must be <= {maxValue}",
|
|
29
|
+
"beWholeNumber": "{fieldName} must be a whole number",
|
|
30
|
+
"beWholeNumberMinMax": "{fieldName} must be a whole number >= {minValue} and <= {maxValue}",
|
|
31
|
+
"beWholeNumberMin": "{fieldName} must be a whole number >= {minValue}",
|
|
32
|
+
"beWholeNumberMax": "{fieldName} must be a whole number <= {maxValue}",
|
|
33
|
+
"beBigInteger": "{fieldName} must be a bigint",
|
|
34
|
+
"beBigIntegerMinMax": "{fieldName} must be a bigint >= {minValue} and <= {maxValue}",
|
|
35
|
+
"beBigIntegerMin": "{fieldName} must be a bigint >= {minValue}",
|
|
36
|
+
"beBigIntegerMax": "{fieldName} must be a bigint <= {maxValue}",
|
|
37
|
+
"beBoolean": "{fieldName} must be true or false",
|
|
38
|
+
"beDate": "{fieldName} must be a date",
|
|
39
|
+
"beDateTime": "{fieldName} must be a date/time",
|
|
40
|
+
"beTime": "{fieldName} must be a time",
|
|
41
|
+
"beTimestampMilliseconds": "{fieldName} must be a timestamp in milliseconds",
|
|
42
|
+
"beTimestampSeconds": "{fieldName} must be a timestamp in seconds",
|
|
43
|
+
"beObject": "{fieldName} must be an object",
|
|
44
|
+
"beArray": "{fieldName} must be an array",
|
|
45
|
+
"beArrayValue": "{fieldName} must be an array with at least one item",
|
|
46
|
+
"beIncluded": "{fieldName} is unrecognised",
|
|
47
|
+
"beByteArray": "{fieldName} must be a byte array",
|
|
48
|
+
"beUrn": "{fieldName} must be a correctly formatted urn",
|
|
49
|
+
"beUrl": "{fieldName} must be a correctly formatted url",
|
|
50
|
+
"beJSON": "{fieldName} must be correctly formatted JSON",
|
|
51
|
+
"beEmail": "{fieldName} must be a correctly formatted e-mail address",
|
|
52
|
+
"failed": "Validation failed",
|
|
53
|
+
"failedObject": "Validation of \"{objectName}\" failed"
|
|
54
|
+
},
|
|
55
|
+
"guard": {
|
|
56
|
+
"undefined": "Property \"{property}\" must be defined, it is \"{value}\"",
|
|
57
|
+
"string": "Property \"{property}\" must be a string, it is \"{value}\"",
|
|
58
|
+
"stringEmpty": "Property \"{property}\" must have a value, it is empty",
|
|
59
|
+
"stringBase64": "Property \"{property}\" must be a base64 encoded string, it is \"{value}\"",
|
|
60
|
+
"stringBase64Url": "Property \"{property}\" must be a base64 url encoded string, it is \"{value}\"",
|
|
61
|
+
"stringHex": "Property \"{property}\" must be a hex string, it is \"{value}\"",
|
|
62
|
+
"stringHexLength": "Property \"{property}\" must be a hex string of length \"{options}\", it is \"{value}\"",
|
|
63
|
+
"number": "Property \"{property}\" must be a number, it is \"{value}\"",
|
|
64
|
+
"integer": "Property \"{property}\" must be an integer, it is \"{value}\"",
|
|
65
|
+
"bigint": "Property \"{property}\" must be a bigint, it is \"{value}\"",
|
|
66
|
+
"boolean": "Property \"{property}\" must be a boolean, it is \"{value}\"",
|
|
67
|
+
"date": "Property \"{property}\" must be a date, it is \"{value}\"",
|
|
68
|
+
"timestampMilliseconds": "Property \"{property}\" must be a timestamp in milliseconds, it is \"{value}\"",
|
|
69
|
+
"timestampSeconds": "Property \"{property}\" must be a timestamp in seconds, it is \"{value}\"",
|
|
70
|
+
"objectUndefined": "Property \"{property}\" must be an object, it is \"undefined\"",
|
|
71
|
+
"object": "Property \"{property}\" must be an object, it is \"{value}\"",
|
|
72
|
+
"objectValue": "Property \"{property}\" must be an object, with at least one property, it is \"{value}\"",
|
|
73
|
+
"array": "Property \"{property}\" must be an array, it is \"{value}\"",
|
|
74
|
+
"arrayValue": "Property \"{property}\" must be an array with at least one item",
|
|
75
|
+
"arrayOneOf": "Property \"{property}\" must be one of [{options}], it is \"{value}\"",
|
|
76
|
+
"uint8Array": "Property \"{property}\" must be a Uint8Array, it is \"{value}\"",
|
|
77
|
+
"function": "Property \"{property}\" must be a function, it is \"{value}\"",
|
|
78
|
+
"urn": "Property \"{property}\" must be a Urn formatted string, it is \"{value}\"",
|
|
79
|
+
"url": "Property \"{property}\" must be a Url formatted string, it is \"{value}\"",
|
|
80
|
+
"email": "Property \"{property}\" must be string in e-mail format, it is \"{value}\"",
|
|
81
|
+
"length32Multiple": "Property \"{property}\" should be a multiple of 32, it is {value}",
|
|
82
|
+
"lengthEntropy": "Property \"{property}\" should be a multiple of 4, >=16 and <= 32, it is {value}",
|
|
83
|
+
"length3Multiple": "Property \"{property}\" should be a multiple of 3, it is {value}",
|
|
84
|
+
"greaterThan0": "Property \"{property}\" must be greater than zero, it is {value}"
|
|
85
|
+
},
|
|
86
|
+
"objectHelper": {
|
|
87
|
+
"failedBytesToJSON": "Failed converting bytes to JSON"
|
|
88
|
+
},
|
|
89
|
+
"common": {
|
|
90
|
+
"notImplementedMethod": "The method \"{method}\" has not been implemented",
|
|
91
|
+
"validation": "Validation failed"
|
|
92
|
+
},
|
|
93
|
+
"factory": {
|
|
94
|
+
"noUnregister": "There is no {typeName} registered with the name \"{name}\"",
|
|
95
|
+
"noGet": "The requested {typeName} \"{name}\" does not exist in the factory"
|
|
96
|
+
},
|
|
97
|
+
"bitString": {
|
|
98
|
+
"outOfRange": "The index should be >= 0 and less than the length of the bit string"
|
|
99
|
+
},
|
|
100
|
+
"bip39": {
|
|
101
|
+
"missingMnemonicWord": "The mnemonic contains a word not in the wordlist, \"{value}\"",
|
|
102
|
+
"checksumMismatch": "The checksum does not match \"{newChecksum}\" != \"{checksumBits}\""
|
|
103
|
+
},
|
|
104
|
+
"ed25519": {
|
|
105
|
+
"privateKeyLength": "The private key length is incorrect, it should be \"{requiredSize}\" but is \"{actualSize}\"",
|
|
106
|
+
"publicKeyLength": "The public key length is incorrect, it should be \"{requiredSize}\" but is \"{actualSize}\""
|
|
107
|
+
},
|
|
108
|
+
"secp256k1": {
|
|
109
|
+
"privateKeyLength": "The private key length is incorrect, it should be \"{requiredSize}\" but is \"{actualSize}\"",
|
|
110
|
+
"publicKeyLength": "The public key length is incorrect, it should be \"{requiredSize}\" but is \"{actualSize}\""
|
|
111
|
+
},
|
|
112
|
+
"x25519": {
|
|
113
|
+
"invalidPublicKey": "Invalid Ed25519 Public Key"
|
|
114
|
+
},
|
|
115
|
+
"blake2b": {
|
|
116
|
+
"outputLength64": "The output length should be between 1 and 64, it is \"{outputLength}\"",
|
|
117
|
+
"keyLength64": "The key length should be between 1 and 64, it is \"{keyLength}\""
|
|
118
|
+
},
|
|
119
|
+
"sha512": {
|
|
120
|
+
"bitSize": "Only 224, 256, 384 or 512 bits are supported, it is \"{bitSize}\""
|
|
121
|
+
},
|
|
122
|
+
"sha256": {
|
|
123
|
+
"bitSize": "Only 224 or 256 bits are supported, it is \"{bitSize}\""
|
|
124
|
+
},
|
|
125
|
+
"hmacSha256": {
|
|
126
|
+
"bitSize": "Only 224 or 256 bits are supported, it is \"{bitSize}\""
|
|
127
|
+
},
|
|
128
|
+
"hmacSha512": {
|
|
129
|
+
"bitSize": "Only 224, 256, 384 or 512 bits are supported, it is \"{bitSize}\""
|
|
130
|
+
},
|
|
131
|
+
"base32": {
|
|
132
|
+
"invalidCharacter": "Data contains a character \"{invalidCharacter}\" which is not in the charset"
|
|
133
|
+
},
|
|
134
|
+
"base64": {
|
|
135
|
+
"length4Multiple": "Invalid length should be a multiple of 4, it is \"{value}\""
|
|
136
|
+
},
|
|
137
|
+
"bech32": {
|
|
138
|
+
"decodeFailed": "The address contains decoding failed for address \"{bech32}\"",
|
|
139
|
+
"invalidChecksum": "The address contains an invalid checksum in address, \"{bech32}\"",
|
|
140
|
+
"separatorMisused": "The separator character '1' should only be used between hrp and data, \"{bech32}\"",
|
|
141
|
+
"lowerUpper": "The address my use either lowercase or uppercase, \"{bech32}\"",
|
|
142
|
+
"dataTooShort": "The address does not contain enough data to decode, \"{bech32}\""
|
|
143
|
+
},
|
|
144
|
+
"pbkdf2": {
|
|
145
|
+
"keyTooLong": "The requested key length \"{keyLength}\" is too long, based on the \"{macLength}\""
|
|
146
|
+
},
|
|
147
|
+
"chaCha20Poly1305": {
|
|
148
|
+
"noAadWithData": "You can not set the aad when there is already data",
|
|
149
|
+
"noAuthTag": "Can not finalise when the auth tag is not set",
|
|
150
|
+
"authenticationFailed": "The data could not be authenticated",
|
|
151
|
+
"authTagDecrypting": "Can not get the auth tag when decrypting",
|
|
152
|
+
"authTagEncrypting": "Can not set the auth tag when encrypting",
|
|
153
|
+
"noAuthTagSet": "The auth tag has not been set"
|
|
154
|
+
},
|
|
155
|
+
"bip44": {
|
|
156
|
+
"unsupportedKeyType": "The key type \"{keyType}\" is not supported"
|
|
157
|
+
},
|
|
158
|
+
"slip0010": {
|
|
159
|
+
"invalidSeed": "The seed is invalid \"{seed}\""
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
"commands": {
|
|
163
|
+
"merge-locales": {
|
|
164
|
+
"options": {
|
|
165
|
+
"config": {
|
|
166
|
+
"param": "--config '<'file'>'",
|
|
167
|
+
"description": "Path to the JSON configuration file."
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
"progress": {
|
|
171
|
+
"loadingConfigJson": "Loading Config JSON",
|
|
172
|
+
"creatingOutputDirectory": "Creating Output Directory",
|
|
173
|
+
"writingMergedLocales": "Writing Merged Locales",
|
|
174
|
+
"mergingLocalesForPackage": "Merging Locales for Package"
|
|
175
|
+
},
|
|
176
|
+
"labels": {
|
|
177
|
+
"configJson": "Config JSON",
|
|
178
|
+
"workingDirectory": "Working Directory",
|
|
179
|
+
"outputDirectory": "Output Directory",
|
|
180
|
+
"npmRoot": "NPM Root",
|
|
181
|
+
"sourcePackages": "Source Packages",
|
|
182
|
+
"writingLocale": "Writing Locale",
|
|
183
|
+
"mergingLocale": "Merging Locale"
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
},
|
|
187
|
+
"cli": {
|
|
188
|
+
"progress": {
|
|
189
|
+
"done": "Done.",
|
|
190
|
+
"error": "Error",
|
|
191
|
+
"loadingEnvFiles": "Loading env files",
|
|
192
|
+
"pleaseWait": "Please wait...",
|
|
193
|
+
"writingJsonFile": "Writing JSON file",
|
|
194
|
+
"writingEnvFile": "Writing env file",
|
|
195
|
+
"readingJsonFile": "Reading JSON file",
|
|
196
|
+
"readingEnvFile": "Reading env file"
|
|
197
|
+
},
|
|
198
|
+
"options": {
|
|
199
|
+
"lang": {
|
|
200
|
+
"param": "--lang '<'lang'>'",
|
|
201
|
+
"description": "The language to display the output in."
|
|
202
|
+
},
|
|
203
|
+
"load-env": {
|
|
204
|
+
"param": "--load-env [env...]",
|
|
205
|
+
"description": "Load the env files to initialise any environment variables."
|
|
206
|
+
},
|
|
207
|
+
"no-console": {
|
|
208
|
+
"param": "--no-console",
|
|
209
|
+
"description": "Hides the output in the console."
|
|
210
|
+
},
|
|
211
|
+
"json": {
|
|
212
|
+
"param": "--json '<'filename'>'",
|
|
213
|
+
"description": "Creates a JSON file containing the output."
|
|
214
|
+
},
|
|
215
|
+
"env": {
|
|
216
|
+
"param": "--env '<'filename'>'",
|
|
217
|
+
"description": "Creates an env file containing the output."
|
|
218
|
+
},
|
|
219
|
+
"merge-json": {
|
|
220
|
+
"param": "--merge-json",
|
|
221
|
+
"description": "If the JSON file already exists merge the data instead of overwriting."
|
|
222
|
+
},
|
|
223
|
+
"merge-env": {
|
|
224
|
+
"param": "--merge-env",
|
|
225
|
+
"description": "If the env file already exists merge the data instead of overwriting."
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
},
|
|
229
|
+
"errorNames": {
|
|
230
|
+
"error": "Error",
|
|
231
|
+
"generalError": "General",
|
|
232
|
+
"guardError": "Guard",
|
|
233
|
+
"conflictError": "Conflict",
|
|
234
|
+
"notFoundError": "Not Found",
|
|
235
|
+
"notSupportedError": "Not Supported",
|
|
236
|
+
"alreadyExistsError": "Already Exists",
|
|
237
|
+
"notImplementedError": "Not Implemented",
|
|
238
|
+
"validationError": "Validation",
|
|
239
|
+
"unprocessableError": "Unprocessable"
|
|
240
|
+
},
|
|
241
|
+
"validation": {
|
|
242
|
+
"defaultFieldName": "The field"
|
|
243
|
+
}
|
|
244
|
+
}
|
package/docs/changelog.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/merge-locales",
|
|
3
|
-
"version": "0.0.1-next.
|
|
3
|
+
"version": "0.0.1-next.2",
|
|
4
4
|
"description": "Tool to merge locale files from all dependencies",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -28,16 +28,14 @@
|
|
|
28
28
|
"dist": "npm run clean && npm run build && npm run merge-locales && npm run test && npm run bundle && npm run docs"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@gtsc/core": "npm:@twin.org/core@next",
|
|
32
|
-
"@gtsc/crypto": "npm:@twin.org/crypto@next",
|
|
33
31
|
"@twin.org/cli-core": "next",
|
|
34
32
|
"@twin.org/core": "next",
|
|
35
|
-
"@twin.org/nameof": "0.0.1-next.
|
|
33
|
+
"@twin.org/nameof": "0.0.1-next.2",
|
|
36
34
|
"commander": "12.1.0",
|
|
37
35
|
"glob": "11.0.0"
|
|
38
36
|
},
|
|
39
37
|
"devDependencies": {
|
|
40
|
-
"@twin.org/nameof-transformer": "0.0.1-next.
|
|
38
|
+
"@twin.org/nameof-transformer": "0.0.1-next.2",
|
|
41
39
|
"@types/node": "22.5.5",
|
|
42
40
|
"@vitest/coverage-v8": "2.1.1",
|
|
43
41
|
"copyfiles": "2.4.1",
|
|
File without changes
|