Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update localization for v1.0.0 #374

Merged
merged 3 commits into from
Dec 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion i18n/sample/src/Profiles.i18n.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
15 changes: 14 additions & 1 deletion i18n/sample/src/ZosJobsProvider.i18n.json
Original file line number Diff line number Diff line change
@@ -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.."
}
2 changes: 1 addition & 1 deletion i18n/sample/src/extension.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -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: ",
Expand Down
4 changes: 4 additions & 0 deletions i18n/sample/src/utils.i18n.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"zosJobsProvider.option.prompt.createOwner": "Owner/Prefix Job Search",
"zosJobsProvider.option.prompt.createId": "Job Id search"
}
37 changes: 33 additions & 4 deletions stringUpdateScript.js
Original file line number Diff line number Diff line change
@@ -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));