gtx-cli 1.2.8-alpha.2 → 1.2.8
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/cli/base.js
CHANGED
|
@@ -43,7 +43,6 @@ const findFilepath_1 = __importStar(require("../fs/findFilepath"));
|
|
|
43
43
|
const console_1 = require("../console");
|
|
44
44
|
const node_path_1 = __importDefault(require("node:path"));
|
|
45
45
|
const node_fs_1 = __importDefault(require("node:fs"));
|
|
46
|
-
const utils_1 = require("../fs/utils");
|
|
47
46
|
const generateSettings_1 = require("../config/generateSettings");
|
|
48
47
|
const chalk_1 = __importDefault(require("chalk"));
|
|
49
48
|
const translate_1 = require("../formats/files/translate");
|
|
@@ -81,7 +80,7 @@ class BaseCLI {
|
|
|
81
80
|
.description('Translate your project using General Translation')
|
|
82
81
|
.option('-c, --config <path>', 'Filepath to config file, by default gt.config.json', (0, findFilepath_1.default)(['gt.config.json']))
|
|
83
82
|
.option('--api-key <key>', 'API key for General Translation cloud service')
|
|
84
|
-
.option('--project-id <id>', 'Project ID for the translation service'
|
|
83
|
+
.option('--project-id <id>', 'Project ID for the translation service')
|
|
85
84
|
.option('--default-language, --default-locale <locale>', 'Default locale (e.g., en)')
|
|
86
85
|
.option('--new, --locales <locales...>', 'Space-separated list of locales (e.g., en fr es)')
|
|
87
86
|
.option('--dry-run', 'Dry run, does not send updates to General Translation API', false)
|
package/dist/cli/react.js
CHANGED
|
@@ -46,7 +46,6 @@ const chalk_1 = __importDefault(require("chalk"));
|
|
|
46
46
|
const postProcess_1 = require("../hooks/postProcess");
|
|
47
47
|
const base_1 = require("./base");
|
|
48
48
|
const wrapContent_1 = __importDefault(require("../react/parse/wrapContent"));
|
|
49
|
-
const utils_1 = require("../fs/utils");
|
|
50
49
|
const generateSettings_1 = require("../config/generateSettings");
|
|
51
50
|
const saveJSON_1 = require("../fs/saveJSON");
|
|
52
51
|
const parseFilesConfig_1 = require("../fs/config/parseFilesConfig");
|
|
@@ -79,7 +78,7 @@ class ReactCLI extends base_1.BaseCLI {
|
|
|
79
78
|
.description('Submits the project to the General Translation API for translation. Translations created using this command will require human approval.')
|
|
80
79
|
.option('-c, --config <path>', 'Filepath to config file, by default gt.config.json', (0, findFilepath_1.default)(['gt.config.json']))
|
|
81
80
|
.option('--api-key <key>', 'API key for General Translation cloud service')
|
|
82
|
-
.option('--project-id <id>', 'Project ID for the translation service'
|
|
81
|
+
.option('--project-id <id>', 'Project ID for the translation service')
|
|
83
82
|
.option('--version-id <id>', 'Version ID for the translation service')
|
|
84
83
|
.option('--tsconfig, --jsconfig <path>', 'Path to jsconfig or tsconfig file', (0, findFilepath_1.default)(['./tsconfig.json', './jsconfig.json']))
|
|
85
84
|
.option('--dictionary <path>', 'Path to dictionary file')
|
|
@@ -102,7 +101,7 @@ class ReactCLI extends base_1.BaseCLI {
|
|
|
102
101
|
.description('Scans the project for a dictionary and/or <T> tags, and sends the updates to the General Translation API for translation.')
|
|
103
102
|
.option('-c, --config <path>', 'Filepath to config file, by default gt.config.json', (0, findFilepath_1.default)(['gt.config.json']))
|
|
104
103
|
.option('--api-key <key>', 'API key for General Translation cloud service')
|
|
105
|
-
.option('--project-id <id>', 'Project ID for the translation service'
|
|
104
|
+
.option('--project-id <id>', 'Project ID for the translation service')
|
|
106
105
|
.option('--version-id <id>', 'Version ID for the translation service')
|
|
107
106
|
.option('--tsconfig, --jsconfig <path>', 'Path to jsconfig or tsconfig file', (0, findFilepath_1.default)(['./tsconfig.json', './jsconfig.json']))
|
|
108
107
|
.option('--dictionary <path>', 'Path to dictionary file')
|
|
@@ -14,6 +14,7 @@ const parseFilesConfig_1 = require("../fs/config/parseFilesConfig");
|
|
|
14
14
|
const findFilepath_1 = require("../fs/findFilepath");
|
|
15
15
|
const validateSettings_1 = require("./validateSettings");
|
|
16
16
|
const constants_1 = require("../utils/constants");
|
|
17
|
+
const utils_1 = require("../fs/utils");
|
|
17
18
|
/**
|
|
18
19
|
* Generates settings from any
|
|
19
20
|
* @param options - The options to generate settings from
|
|
@@ -52,8 +53,7 @@ async function generateSettings(options) {
|
|
|
52
53
|
// Add apiKey if not provided
|
|
53
54
|
mergedOptions.apiKey = mergedOptions.apiKey || process.env.GT_API_KEY;
|
|
54
55
|
// Add projectId if not provided
|
|
55
|
-
mergedOptions.projectId =
|
|
56
|
-
mergedOptions.projectId || process.env.GT_PROJECT_ID;
|
|
56
|
+
mergedOptions.projectId = mergedOptions.projectId || (0, utils_1.resolveProjectId)();
|
|
57
57
|
// Add baseUrl if not provided
|
|
58
58
|
mergedOptions.baseUrl = mergedOptions.baseUrl || internal_1.defaultBaseUrl;
|
|
59
59
|
// Add dashboardUrl if not provided
|
package/dist/console/index.d.ts
CHANGED
|
@@ -14,6 +14,6 @@ export declare const noSourceFileError = "No source file found! Please double ch
|
|
|
14
14
|
export declare const noDataFormatError = "No data format found! Please make sure your translationsDir parameter ends with a supported file extension.";
|
|
15
15
|
export declare const noSupportedDataFormatError = "Unsupported data format! Please make sure your translationsDir parameter ends with a supported file extension.";
|
|
16
16
|
export declare const noApiKeyError = "No API key found! Please provide an API key using the --api-key flag or set the GT_API_KEY environment variable.";
|
|
17
|
-
export declare const devApiKeyError = "You are using a development API key. Please use a production API key to
|
|
17
|
+
export declare const devApiKeyError = "You are using a development API key. Please use a production API key to use the General Translation API.\nYou can generate a production API key with the command: npx gtx-cli auth -t production";
|
|
18
18
|
export declare const noProjectIdError = "No project ID found! Please provide a project ID using the --project-id flag, specify it in your gt.config.json file, or set the GT_PROJECT_ID environment variable.";
|
|
19
19
|
export declare const noVersionIdError = "No version ID found! Please provide a version ID using the --version-id flag or specify it in your gt.config.json file as the _versionId property.";
|
package/dist/console/index.js
CHANGED
|
@@ -43,6 +43,6 @@ exports.noSourceFileError = `No source file found! Please double check your tran
|
|
|
43
43
|
exports.noDataFormatError = `No data format found! Please make sure your translationsDir parameter ends with a supported file extension.`;
|
|
44
44
|
exports.noSupportedDataFormatError = `Unsupported data format! Please make sure your translationsDir parameter ends with a supported file extension.`;
|
|
45
45
|
exports.noApiKeyError = `No API key found! Please provide an API key using the --api-key flag or set the GT_API_KEY environment variable.`;
|
|
46
|
-
exports.devApiKeyError = `You are using a development API key. Please use a production API key to
|
|
46
|
+
exports.devApiKeyError = `You are using a development API key. Please use a production API key to use the General Translation API.\nYou can generate a production API key with the command: npx gtx-cli auth -t production`;
|
|
47
47
|
exports.noProjectIdError = `No project ID found! Please provide a project ID using the --project-id flag, specify it in your gt.config.json file, or set the GT_PROJECT_ID environment variable.`;
|
|
48
48
|
exports.noVersionIdError = `No version ID found! Please provide a version ID using the --version-id flag or specify it in your gt.config.json file as the _versionId property.`;
|