gtx-cli 1.2.25-alpha.10 → 1.2.25-alpha.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.
|
@@ -132,21 +132,21 @@ function generateStatusSuffixText(downloadStatus, fileQueryData) {
|
|
|
132
132
|
// Add completed locales
|
|
133
133
|
if (status.completed.size > 0) {
|
|
134
134
|
const completedCodes = Array.from(status.completed)
|
|
135
|
-
.map((locale) => generaltranslation_1.
|
|
135
|
+
.map((locale) => (0, generaltranslation_1.getLocaleProperties)(locale).code)
|
|
136
136
|
.join(', ');
|
|
137
137
|
localeStatuses.push(chalk_1.default.green(`${completedCodes}`));
|
|
138
138
|
}
|
|
139
139
|
// Add failed locales
|
|
140
140
|
if (status.failed.size > 0) {
|
|
141
141
|
const failedCodes = Array.from(status.failed)
|
|
142
|
-
.map((locale) => generaltranslation_1.
|
|
142
|
+
.map((locale) => (0, generaltranslation_1.getLocaleProperties)(locale).code)
|
|
143
143
|
.join(', ');
|
|
144
144
|
localeStatuses.push(chalk_1.default.red(`${failedCodes}`));
|
|
145
145
|
}
|
|
146
146
|
// Add pending locales
|
|
147
147
|
if (status.pending.size > 0) {
|
|
148
148
|
const pendingCodes = Array.from(status.pending)
|
|
149
|
-
.map((locale) => generaltranslation_1.
|
|
149
|
+
.map((locale) => (0, generaltranslation_1.getLocaleProperties)(locale).code)
|
|
150
150
|
.join(', ');
|
|
151
151
|
localeStatuses.push(chalk_1.default.yellow(`${pendingCodes}`));
|
|
152
152
|
}
|
|
@@ -47,7 +47,7 @@ const waitForUpdates = async (apiKey, baseUrl, versionId, startTime, timeoutDura
|
|
|
47
47
|
chalk_1.default.green(`[${availableLocales.length}/${locales.length}]`) +
|
|
48
48
|
` translations completed`,
|
|
49
49
|
...availableLocales.map((locale) => {
|
|
50
|
-
const localeProperties = generaltranslation_1.
|
|
50
|
+
const localeProperties = (0, generaltranslation_1.getLocaleProperties)(locale);
|
|
51
51
|
return `Translation completed for ${chalk_1.default.green(localeProperties.name)} (${chalk_1.default.green(localeProperties.code)})`;
|
|
52
52
|
}),
|
|
53
53
|
];
|
|
@@ -6,18 +6,18 @@ const console_1 = require("../console");
|
|
|
6
6
|
function validateSettings(settings) {
|
|
7
7
|
// Validate locales
|
|
8
8
|
for (const locale of settings.locales) {
|
|
9
|
-
if (!generaltranslation_1.
|
|
9
|
+
if (!(0, generaltranslation_1.isValidLocale)(locale)) {
|
|
10
10
|
(0, console_1.logErrorAndExit)(`Provided locales: "${settings?.locales?.join()}", ${locale} is not a valid locale!`);
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
|
-
if (settings.defaultLocale && !generaltranslation_1.
|
|
13
|
+
if (settings.defaultLocale && !(0, generaltranslation_1.isValidLocale)(settings.defaultLocale)) {
|
|
14
14
|
(0, console_1.logErrorAndExit)(`defaultLocale: ${settings.defaultLocale} is not a valid locale!`);
|
|
15
15
|
}
|
|
16
16
|
// defaultLocale cannot be a superset of any other locale
|
|
17
17
|
if (settings.defaultLocale &&
|
|
18
|
-
settings.locales.some((locale) => generaltranslation_1.
|
|
19
|
-
!generaltranslation_1.
|
|
20
|
-
const locale = settings.locales.find((locale) => generaltranslation_1.
|
|
18
|
+
settings.locales.some((locale) => (0, generaltranslation_1.isSupersetLocale)(settings.defaultLocale, locale) &&
|
|
19
|
+
!(0, generaltranslation_1.isSupersetLocale)(locale, settings.defaultLocale))) {
|
|
20
|
+
const locale = settings.locales.find((locale) => (0, generaltranslation_1.isSupersetLocale)(settings.defaultLocale, locale));
|
|
21
21
|
(0, console_1.logErrorAndExit)(`defaultLocale: ${settings.defaultLocale} is a superset of another locale (${locale})! Please change the defaultLocale to a more specific locale.`);
|
|
22
22
|
}
|
|
23
23
|
}
|
|
@@ -42,7 +42,7 @@ async function parseNextConfig(filePath) {
|
|
|
42
42
|
.filter((locale) => typeof locale === 'string')
|
|
43
43
|
: undefined;
|
|
44
44
|
// Ensure approvedLocales is an array of strings
|
|
45
|
-
const validLocales = locales && locales.every((locale) => generaltranslation_1.
|
|
45
|
+
const validLocales = locales && locales.every((locale) => (0, generaltranslation_1.isValidLocale)(locale))
|
|
46
46
|
? locales
|
|
47
47
|
: undefined;
|
|
48
48
|
// Return the extracted values if they pass type checks or return null
|
package/dist/setup/userInput.js
CHANGED
|
@@ -24,7 +24,7 @@ async function getDesiredLocales() {
|
|
|
24
24
|
return 'Please enter at least one locale';
|
|
25
25
|
}
|
|
26
26
|
for (const locale of localeList) {
|
|
27
|
-
if (!generaltranslation_1.
|
|
27
|
+
if (!(0, generaltranslation_1.isValidLocale)(locale)) {
|
|
28
28
|
return 'Please enter a valid locale (e.g., en, fr, es)';
|
|
29
29
|
}
|
|
30
30
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gtx-cli",
|
|
3
|
-
"version": "1.2.25-alpha.
|
|
3
|
+
"version": "1.2.25-alpha.11",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"bin": "dist/main.js",
|
|
6
6
|
"files": [
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
"esbuild": "^0.25.4",
|
|
80
80
|
"fast-glob": "^3.3.3",
|
|
81
81
|
"form-data": "^4.0.2",
|
|
82
|
-
"generaltranslation": "^7.0.0-alpha.
|
|
82
|
+
"generaltranslation": "^7.0.0-alpha.11",
|
|
83
83
|
"open": "^10.1.1",
|
|
84
84
|
"ora": "^8.2.0",
|
|
85
85
|
"resolve": "^1.22.10",
|