diff --git a/i18n/sample/src/Profiles.i18n.json b/i18n/sample/src/Profiles.i18n.json index 30dd3592fa..916f1dc256 100644 --- a/i18n/sample/src/Profiles.i18n.json +++ b/i18n/sample/src/Profiles.i18n.json @@ -1,12 +1,13 @@ { "loadNamedProfile.error.profileName": "Could not find profile named: ", "loadNamedProfile.error.period": ".", + "loadNamedProfile.warn.noDefaultProfile": "Unable to locate a default profile. CLI may not be installed. ", "createNewConnection.option.prompt.url.placeholder": "https://url:port", "createNewConnection.option.prompt.url": "Enter a z/OSMF URL in the format 'https://url:port'.", "createNewConnection.enterzosmfURL": "No valid value for z/OSMF URL. Operation Cancelled", "createNewConnection.option.prompt.userName.placeholder": "Optional: User Name", "createNewConnection.option.prompt.userName": "Enter the user name for the connection", - "createNewConnection.option.prompt.passWord.placeholder": "Optional: Password", + "createNewConnection.option.prompt.password.placeholder": "Optional: Password", "createNewConnection.option.prompt.password": "Enter a password for the connection", "createNewConnection.option.prompt.ru.placeholder": "Reject Unauthorized Connections", "createNewConnection.rejectUnauthorize": "Operation Cancelled", diff --git a/i18n/sample/src/ZosJobsProvider.i18n.json b/i18n/sample/src/ZosJobsProvider.i18n.json index b8842d986a..6dc4083b6e 100644 --- a/i18n/sample/src/ZosJobsProvider.i18n.json +++ b/i18n/sample/src/ZosJobsProvider.i18n.json @@ -1,4 +1,17 @@ { + "FavoriteSession": "Favorites", "deleteJob.job": "Job ", - "deleteJob.delete": " deleted" + "deleteJob.delete": " deleted", + "initializeFavorites.log.debug": "initializing favorites", + "initializeJobsFavorites.error.profile1": "Error: You have Jobs favorites that refer to a non-existent CLI profile named: ", + "initializeJobsFavorites.error.profile2": ". To resolve this, you can create a profile with this name, ", + "initializeJobsFavorites.error.profile3": "or remove the favorites with this profile name from the Zowe-Jobs-Persistent setting, ", + "initializeJobsFavorites.error.profile4": "which can be found in your VS Code user settings.", + "searchHistory.options.prompt": "Select a filter", + "enterPattern.pattern": "No selection made.", + "jobsFilterPrompt.option.prompt.owner": "Enter the Job Owner. Default is *.", + "jobsFilterPrompt.enterPrefix": "Search Cancelled", + "jobsFilterPrompt.option.prompt.prefix": "Enter a Job prefix. Default is *.", + "jobsFilterPrompt.option.prompt.jobid": "Enter a Job id", + "SpecifyCriteria": "Create new.." } \ No newline at end of file diff --git a/i18n/sample/src/extension.i18n.json b/i18n/sample/src/extension.i18n.json index 66bf989920..10080f717b 100644 --- a/i18n/sample/src/extension.i18n.json +++ b/i18n/sample/src/extension.i18n.json @@ -90,9 +90,9 @@ "saveFile.log.error.session": "Couldn't locate session when saving data set!", "saveFile.log.debug.saving": "Saving file ", "saveFile.error.saveFailed": "Data set failed to save. Data set may have been deleted on mainframe.", + "saveFile.response.save.title": "Saving data set...", "saveFile.error.ZosmfEtagMismatchError": "Rest API failure with HTTP(S) status 412", "saveFile.error.etagMismatch": "Remote file has been modified in the meantime.\nSelect 'Compare' to resolve the conflict.", - "saveFile.response.save.title": "Saving data set...", "saveUSSFile.log.debug.saveRequest": "save requested for USS file ", "saveUSSFile.response.title": "Saving file...", "saveUSSFile.log.error.save": "Error encountered when saving USS file: ", diff --git a/i18n/sample/src/utils.i18n.json b/i18n/sample/src/utils.i18n.json index e69de29bb2..c94418e55b 100644 --- a/i18n/sample/src/utils.i18n.json +++ b/i18n/sample/src/utils.i18n.json @@ -0,0 +1,4 @@ +{ + "zosJobsProvider.option.prompt.createOwner": "Owner/Prefix Job Search", + "zosJobsProvider.option.prompt.createId": "Job Id search" +} \ No newline at end of file diff --git a/stringUpdateScript.js b/stringUpdateScript.js index 1818730cee..bdeec70c80 100644 --- a/stringUpdateScript.js +++ b/stringUpdateScript.js @@ -1,33 +1,62 @@ +/* +* This program and the accompanying materials are made available under the terms of the * +* Eclipse Public License v2.0 which accompanies this distribution, and is available at * +* https://www.eclipse.org/legal/epl-v20.html * +* * +* SPDX-License-Identifier: EPL-2.0 * +* * +* Copyright Contributors to the Zowe Project. * +* * +*/ + +// This script creates the i18n/sample template used for adding/updating i18n files fs = require('fs'); + +// Read localization metadata files +// Consider adding support for creating directories in the filepath if they don't exist yet +var parsedUssNodeActions = JSON.parse(fs.readFileSync('./out/src/uss/ussNodeActions.nls.metadata.json').toString()); +var keysPairsUssNodeActions = {}; var parsedDatasetTree = JSON.parse(fs.readFileSync('./out/src/DatasetTree.nls.metadata.json').toString()); var keysPairsDatasetTree = {}; var parsedExtension = JSON.parse(fs.readFileSync('./out/src/extension.nls.metadata.json').toString()); var keysPairsExtension = {}; var parsedProfileLoader = JSON.parse(fs.readFileSync('./out/src/ProfileLoader.nls.metadata.json').toString()); var keysPairsProfileLoader = {}; +var parsedProfiles = JSON.parse(fs.readFileSync('./out/src/Profiles.nls.metadata.json').toString()); +var keysPairsProfiles = {}; var parsedUSSTree = JSON.parse(fs.readFileSync('./out/src/USSTree.nls.metadata.json').toString()); var keysPairsUSSTree = {}; -var parsedUssNodeActions = JSON.parse(fs.readFileSync('./out/src/uss/ussNodeActions.nls.metadata.json').toString()); -var keysPairsUssNodeActions = {}; +var parsedUtils = JSON.parse(fs.readFileSync('./out/src/utils.nls.metadata.json').toString()); +var keysPairsUtils = {}; +var parsedZosJobsProvider = JSON.parse(fs.readFileSync('./out/src/ZosJobsProvider.nls.metadata.json').toString()); +var keysPairsZosJobsProvider = {}; var parsedZoweNode = JSON.parse(fs.readFileSync('./out/src/ZoweNode.nls.metadata.json').toString()); var keysPairsZoweNode = {}; var parsedZoweUSSNode = JSON.parse(fs.readFileSync('./out/src/ZoweUSSNode.nls.metadata.json').toString()); var keysPairsZoweUSSNode = {}; var keysPairsPackage = JSON.parse(fs.readFileSync('./package.nls.json').toString()); + // Extract localization key/value pairs from metadata files +parsedUssNodeActions.keys.forEach((key, i) => keysPairsUssNodeActions[key] = parsedUssNodeActions.messages[i]); parsedDatasetTree.keys.forEach((key, i) => keysPairsDatasetTree[key] = parsedDatasetTree.messages[i]); parsedExtension.keys.forEach((key, i) => keysPairsExtension[key] = parsedExtension.messages[i]); parsedProfileLoader.keys.forEach((key, i) => keysPairsProfileLoader[key] = parsedProfileLoader.messages[i]); +parsedProfiles.keys.forEach((key, i) => keysPairsProfiles[key] = parsedProfiles.messages[i]); parsedUSSTree.keys.forEach((key, i) => keysPairsUSSTree[key] = parsedUSSTree.messages[i]); -parsedUssNodeActions.keys.forEach((key, i) => keysPairsUssNodeActions[key] = parsedUssNodeActions.messages[i]); +parsedUtils.keys.forEach((key, i) => keysPairsUtils[key] = parsedUtils.messages[i]); +parsedZosJobsProvider.keys.forEach((key, i) => keysPairsZosJobsProvider[key] = parsedZosJobsProvider.messages[i]); parsedZoweNode.keys.forEach((key, i) => keysPairsZoweNode[key] = parsedZoweNode.messages[i]); parsedZoweUSSNode.keys.forEach((key, i) => keysPairsZoweUSSNode[key] = parsedZoweUSSNode.messages[i]); + // Write to i18n sample folder to create template for new languages +fs.writeFileSync('./i18n/sample/src/uss/ussNodeActions.i18n.json', JSON.stringify(keysPairsUssNodeActions, null, 4)); fs.writeFileSync('./i18n/sample/src/DatasetTree.i18n.json', JSON.stringify(keysPairsDatasetTree, null, 4)); fs.writeFileSync('./i18n/sample/src/extension.i18n.json', JSON.stringify(keysPairsExtension, null, 4)); fs.writeFileSync('./i18n/sample/src/ProfileLoader.i18n.json', JSON.stringify(keysPairsProfileLoader, null, 4)); +fs.writeFileSync('./i18n/sample/src/Profiles.i18n.json', JSON.stringify(keysPairsProfiles, null, 4)); fs.writeFileSync('./i18n/sample/src/USSTree.i18n.json', JSON.stringify(keysPairsUSSTree, null, 4)); -fs.writeFileSync('./i18n/sample/src/uss/ussNodeActions.i18n.json', JSON.stringify(keysPairsUssNodeActions, null, 4)); +fs.writeFileSync('./i18n/sample/src/utils.i18n.json', JSON.stringify(keysPairsUtils, null, 4)); +fs.writeFileSync('./i18n/sample/src/ZosJobsProvider.i18n.json', JSON.stringify(keysPairsZosJobsProvider, null, 4)); fs.writeFileSync('./i18n/sample/src/ZoweNode.i18n.json', JSON.stringify(keysPairsZoweNode, null, 4)); fs.writeFileSync('./i18n/sample/src/ZoweUSSNode.i18n.json', JSON.stringify(keysPairsZoweUSSNode, null, 4)); fs.writeFileSync('./i18n/sample/package.i18n.json', JSON.stringify(keysPairsPackage, null, 4)); \ No newline at end of file