From d2d176a6b88f5b2656ab583713db7e0f1671ad03 Mon Sep 17 00:00:00 2001 From: Tsikhan Koktysh Date: Thu, 16 Nov 2023 16:25:54 +0200 Subject: [PATCH 1/3] #RIV-3 - added l10n translations --- l10n/bundle.l10n.json | 15 ++++++++ .../src/constants/cli/cliOutputComponents.tsx | 38 +++++++++---------- .../src/constants/cli/cliOutputConstants.ts | 6 ++- 3 files changed, 37 insertions(+), 22 deletions(-) diff --git a/l10n/bundle.l10n.json b/l10n/bundle.l10n.json index 16dddf77..a53e5483 100644 --- a/l10n/bundle.l10n.json +++ b/l10n/bundle.l10n.json @@ -2,6 +2,21 @@ "loading...": "loading...", "key(s)": "key(s)", "Something was wrong!": "Something was wrong!", + "Try ": "Try ", + ", our advanced CLI. Check out our Quick Guides to learn more about Redis capabilities.": ", our advanced CLI. Check out our Quick Guides to learn more about Redis capabilities.", + "Connecting...": "Connecting...", + "Pinging Redis server on ": "Pinging Redis server on ", + " is not supported by the RedisInsight CLI. The list of all unsupported commands: ": " is not supported by the RedisInsight CLI. The list of all unsupported commands: ", + " is not supported by the Workbench. The list of all unsupported commands: ": " is not supported by the Workbench. The list of all unsupported commands: ", + "Invalid repeat command option value": "Invalid repeat command option value", + "Client connection previously closed. Run the command after the connection is re-created.": "Client connection previously closed. Run the command after the connection is re-created.", + "Unable to decrypt. Check the system keychain or re-run the command.": "Unable to decrypt. Check the system keychain or re-run the command.", + "Use to see the messages published to all channels in your database.": "Use to see the messages published to all channels in your database.", + " to see the messages published to all channels in your database.": " to see the messages published to all channels in your database.", + " tool to subscribe to channels.": " tool to subscribe to channels.", + " tool to see all the requests processed by the server.": " tool to see all the requests processed by the server.", + "RedisInsight does not support ": "RedisInsight does not support ", + " at the moment, but we are working on it.": " at the moment, but we are working on it.", "Scan more": "Scan more", "Keys are the foundation of Redis.": "Keys are the foundation of Redis.", "No results found.": "No results found." diff --git a/src/webviews/src/constants/cli/cliOutputComponents.tsx b/src/webviews/src/constants/cli/cliOutputComponents.tsx index 9dd57bd0..69ee047c 100644 --- a/src/webviews/src/constants/cli/cliOutputComponents.tsx +++ b/src/webviews/src/constants/cli/cliOutputComponents.tsx @@ -1,5 +1,6 @@ import React, { Fragment } from 'react' import { Link } from 'react-router-dom' +import * as l10n from '@vscode/l10n' import { getRouterLinkProps } from 'uiSrc/services' import { getDbIndex } from 'uiSrc/utils' @@ -13,7 +14,7 @@ export const InitOutputText = ( {emptyOutput && ( - {'Try '} + {l10n.t('Try ')} Workbench - , our advanced CLI. Check out our Quick Guides to learn more about Redis - capabilities. + {l10n.t(', our advanced CLI. Check out our Quick Guides to learn more about Redis capabilities.')} )} , '\n', - 'Connecting...', + l10n.t('Connecting...'), '\n', - 'Pinging Redis server on ', + l10n.t('Pinging Redis server on '), {/* TODO: Remove mock after implementing DB connection: */} redis-12871.c309.us-east-2-1.ec2.cloud.redislabs.com:12871 @@ -39,22 +39,20 @@ export const InitOutputText = ( , ] -const unsupportedCommandTextCli = ' is not supported by the RedisInsight CLI. The list of all unsupported commands: ' -const unsupportedCommandTextWorkbench = ' is not supported by the Workbench. The list of all unsupported commands: ' +const unsupportedCommandTextCli = l10n.t(' is not supported by the RedisInsight CLI. The list of all unsupported commands: ') +const unsupportedCommandTextWorkbench = l10n.t(' is not supported by the Workbench. The list of all unsupported commands: ') // eslint-disable-next-line react-refresh/only-export-components export const cliTexts = { CLI_UNSUPPORTED_COMMANDS: (commandLine: string, commands: string) => commandLine + unsupportedCommandTextCli + commands, WORKBENCH_UNSUPPORTED_COMMANDS: (commandLine: string, commands: string) => commandLine + unsupportedCommandTextWorkbench + commands, - REPEAT_COUNT_INVALID: 'Invalid repeat command option value', - CONNECTION_CLOSED: - 'Client connection previously closed. Run the command after the connection is re-created.', - UNABLE_TO_DECRYPT: - 'Unable to decrypt. Check the system keychain or re-run the command.', + REPEAT_COUNT_INVALID: l10n.t('Invalid repeat command option value'), + CONNECTION_CLOSED: l10n.t('Client connection previously closed. Run the command after the connection is re-created.'), + UNABLE_TO_DECRYPT: l10n.t('Unable to decrypt. Check the system keychain or re-run the command.'), PSUBSCRIBE_COMMAND: (path: string = '') => ( - {'Use '} + {l10n.t('Use ')} Pub/Sub - {' to see the messages published to all channels in your database.'} + {l10n.t(' to see the messages published to all channels in your database.')} ), SUBSCRIBE_COMMAND: (path: string = '') => ( - {'Use '} + {l10n.t('Use ')} Pub/Sub - {' tool to subscribe to channels.'} + {l10n.t(' tool to subscribe to channels.')} ), PSUBSCRIBE_COMMAND_CLI: (path: string = '') => [ @@ -90,7 +88,7 @@ export const cliTexts = { ], MONITOR_COMMAND: (onClick: () => void) => ( - {'Use '} + {l10n.t('Use ')} Profiler - {' tool to see all the requests processed by the server.'} + {l10n.t(' tool to see all the requests processed by the server.')} ), MONITOR_COMMAND_CLI: (onClick: () => void) => [ @@ -109,7 +107,7 @@ export const cliTexts = { ], HELLO3_COMMAND: () => ( - {'RedisInsight does not support '} + {l10n.t('RedisInsight does not support ')} RESP3 - {' at the moment, but we are working on it.'} + {l10n.t(' at the moment, but we are working on it.')} ), HELLO3_COMMAND_CLI: () => [cliTexts.HELLO3_COMMAND(), '\n'], diff --git a/src/webviews/src/constants/cli/cliOutputConstants.ts b/src/webviews/src/constants/cli/cliOutputConstants.ts index 760f61b8..0f3a3a62 100644 --- a/src/webviews/src/constants/cli/cliOutputConstants.ts +++ b/src/webviews/src/constants/cli/cliOutputConstants.ts @@ -1,3 +1,5 @@ +import * as l10n from '@vscode/l10n' + export const ClearCommand = 'clear' export const SelectCommand = 'select' @@ -8,9 +10,9 @@ export enum CliOutputFormatterType { export const ConnectionSuccessOutputText = [ '\n', - 'Connected.', + l10n.t('Connected.'), '\n', - 'Ready to execute commands.', + l10n.t('Ready to execute commands.'), '\n\n', ] export enum CliKeys { From 0efaf2c0710f319e0caacea6bde0bdbcd18c0e87 Mon Sep 17 00:00:00 2001 From: Tsikhan Koktysh Date: Fri, 17 Nov 2023 09:18:42 +0200 Subject: [PATCH 2/3] #RIV-3 - added l10n translations --- .../src/constants/cli/cliOutputComponents.tsx | 51 ++++++++++++++----- 1 file changed, 39 insertions(+), 12 deletions(-) diff --git a/src/webviews/src/constants/cli/cliOutputComponents.tsx b/src/webviews/src/constants/cli/cliOutputComponents.tsx index 69ee047c..b1a25917 100644 --- a/src/webviews/src/constants/cli/cliOutputComponents.tsx +++ b/src/webviews/src/constants/cli/cliOutputComponents.tsx @@ -14,7 +14,10 @@ export const InitOutputText = ( {emptyOutput && ( - {l10n.t('Try ')} + {l10n.t({ + message: 'Try ', + comment: 'Context: Try "Workbench", our advanced CLI. Check out our Quick Guides to learn more about Redis capabilities.', + })} Workbench - {l10n.t(', our advanced CLI. Check out our Quick Guides to learn more about Redis capabilities.')} + {l10n.t({ + message: ', our advanced CLI. Check out our Quick Guides to learn more about Redis capabilities.', + comment: 'Context: Try "Workbench", our advanced CLI. Check out our Quick Guides to learn more about Redis capabilities.', + })} )} , @@ -39,8 +45,14 @@ export const InitOutputText = ( , ] -const unsupportedCommandTextCli = l10n.t(' is not supported by the RedisInsight CLI. The list of all unsupported commands: ') -const unsupportedCommandTextWorkbench = l10n.t(' is not supported by the Workbench. The list of all unsupported commands: ') +const unsupportedCommandTextCli = l10n.t({ + message: ' is not supported by the RedisInsight CLI. The list of all unsupported commands: ', + comment: 'Example: INFO is not supported by the RedisInsight CLI. The list of all unsupported commands: ...', +}) +const unsupportedCommandTextWorkbench = l10n.t({ + message: ' is not supported by the Workbench. The list of all unsupported commands: ', + comment: 'Example: AUTH is not supported by the Workbench. The list of all unsupported commands: ...', +}) // eslint-disable-next-line react-refresh/only-export-components export const cliTexts = { CLI_UNSUPPORTED_COMMANDS: (commandLine: string, commands: string) => @@ -52,7 +64,10 @@ export const cliTexts = { UNABLE_TO_DECRYPT: l10n.t('Unable to decrypt. Check the system keychain or re-run the command.'), PSUBSCRIBE_COMMAND: (path: string = '') => ( - {l10n.t('Use ')} + {l10n.t({ + message: 'Use ', + comment: 'Context: Use "Pub/Sub" to see the messages published to all channels in your database.', + })} Pub/Sub - {l10n.t(' to see the messages published to all channels in your database.')} + {l10n.t({ + message: ' to see the messages published to all channels in your database.', + comment: 'Context: Use "Pub/Sub" to see the messages published to all channels in your database.', + })} ), SUBSCRIBE_COMMAND: (path: string = '') => ( - {l10n.t('Use ')} + {l10n.t({ message: 'Use ', comment: 'Use "Pub/Sub" tool to subscribe to channels.' })} Pub/Sub - {l10n.t(' tool to subscribe to channels.')} + {l10n.t({ message: ' tool to subscribe to channels.', comment: 'Use "Pub/Sub" tool to subscribe to channels.' })} ), PSUBSCRIBE_COMMAND_CLI: (path: string = '') => [ @@ -88,7 +106,7 @@ export const cliTexts = { ], MONITOR_COMMAND: (onClick: () => void) => ( - {l10n.t('Use ')} + {l10n.t({ message: 'Use ', comment: 'Context: Use "Profiler" tool to see all the requests processed by the server.' })} Profiler - {l10n.t(' tool to see all the requests processed by the server.')} + {l10n.t({ + message: ' tool to see all the requests processed by the server.', + comment: 'Context: Use "Profiler" tool to see all the requests processed by the server.', + })} ), MONITOR_COMMAND_CLI: (onClick: () => void) => [ @@ -107,7 +128,10 @@ export const cliTexts = { ], HELLO3_COMMAND: () => ( - {l10n.t('RedisInsight does not support ')} + {l10n.t({ + message: 'RedisInsight does not support ', + comment: 'Context: RedisInsight does not support "RESP3" at the moment, but we are working on it.', + })} RESP3 - {l10n.t(' at the moment, but we are working on it.')} + {l10n.t({ + message: ' at the moment, but we are working on it.', + comment: 'Context: RedisInsight does not support "RESP3" at the moment, but we are working on it.', + })} ), HELLO3_COMMAND_CLI: () => [cliTexts.HELLO3_COMMAND(), '\n'], From dd017e44adaeb6124fcd09ae617ea1a532440120 Mon Sep 17 00:00:00 2001 From: Tsikhan Koktysh Date: Fri, 17 Nov 2023 11:12:19 +0200 Subject: [PATCH 3/3] #RIV-3 - added l10n translations --- l10n/bundle.l10n.json | 84 +++++++++++++++++++++++++++++++++++++------ 1 file changed, 74 insertions(+), 10 deletions(-) diff --git a/l10n/bundle.l10n.json b/l10n/bundle.l10n.json index a53e5483..18c43a0a 100644 --- a/l10n/bundle.l10n.json +++ b/l10n/bundle.l10n.json @@ -2,21 +2,85 @@ "loading...": "loading...", "key(s)": "key(s)", "Something was wrong!": "Something was wrong!", - "Try ": "Try ", - ", our advanced CLI. Check out our Quick Guides to learn more about Redis capabilities.": ", our advanced CLI. Check out our Quick Guides to learn more about Redis capabilities.", + "Connected.": "Connected.", + "Ready to execute commands.": "Ready to execute commands.", + "Try /Context: Try \"Workbench\", our advanced CLI. Check out our Quick Guides to learn more about Redis capabilities.": { + "message": "Try ", + "comment": [ + "Context: Try \"Workbench\", our advanced CLI. Check out our Quick Guides to learn more about Redis capabilities." + ] + }, + ", our advanced CLI. Check out our Quick Guides to learn more about Redis capabilities./Context: Try \"Workbench\", our advanced CLI. Check out our Quick Guides to learn more about Redis capabilities.": { + "message": ", our advanced CLI. Check out our Quick Guides to learn more about Redis capabilities.", + "comment": [ + "Context: Try \"Workbench\", our advanced CLI. Check out our Quick Guides to learn more about Redis capabilities." + ] + }, "Connecting...": "Connecting...", "Pinging Redis server on ": "Pinging Redis server on ", - " is not supported by the RedisInsight CLI. The list of all unsupported commands: ": " is not supported by the RedisInsight CLI. The list of all unsupported commands: ", - " is not supported by the Workbench. The list of all unsupported commands: ": " is not supported by the Workbench. The list of all unsupported commands: ", + " is not supported by the RedisInsight CLI. The list of all unsupported commands: /Example: INFO is not supported by the RedisInsight CLI. The list of all unsupported commands: ...": { + "message": " is not supported by the RedisInsight CLI. The list of all unsupported commands: ", + "comment": [ + "Example: INFO is not supported by the RedisInsight CLI. The list of all unsupported commands: ..." + ] + }, + " is not supported by the Workbench. The list of all unsupported commands: /Example: AUTH is not supported by the Workbench. The list of all unsupported commands: ...": { + "message": " is not supported by the Workbench. The list of all unsupported commands: ", + "comment": [ + "Example: AUTH is not supported by the Workbench. The list of all unsupported commands: ..." + ] + }, "Invalid repeat command option value": "Invalid repeat command option value", "Client connection previously closed. Run the command after the connection is re-created.": "Client connection previously closed. Run the command after the connection is re-created.", "Unable to decrypt. Check the system keychain or re-run the command.": "Unable to decrypt. Check the system keychain or re-run the command.", - "Use to see the messages published to all channels in your database.": "Use to see the messages published to all channels in your database.", - " to see the messages published to all channels in your database.": " to see the messages published to all channels in your database.", - " tool to subscribe to channels.": " tool to subscribe to channels.", - " tool to see all the requests processed by the server.": " tool to see all the requests processed by the server.", - "RedisInsight does not support ": "RedisInsight does not support ", - " at the moment, but we are working on it.": " at the moment, but we are working on it.", + "Use /Context: Use \"Pub/Sub\" to see the messages published to all channels in your database.": { + "message": "Use ", + "comment": [ + "Context: Use \"Pub/Sub\" to see the messages published to all channels in your database." + ] + }, + " to see the messages published to all channels in your database./Context: Use \"Pub/Sub\" to see the messages published to all channels in your database.": { + "message": " to see the messages published to all channels in your database.", + "comment": [ + "Context: Use \"Pub/Sub\" to see the messages published to all channels in your database." + ] + }, + "Use /Use \"Pub/Sub\" tool to subscribe to channels.": { + "message": "Use ", + "comment": [ + "Use \"Pub/Sub\" tool to subscribe to channels." + ] + }, + " tool to subscribe to channels./Use \"Pub/Sub\" tool to subscribe to channels.": { + "message": " tool to subscribe to channels.", + "comment": [ + "Use \"Pub/Sub\" tool to subscribe to channels." + ] + }, + "Use /Context: Use \"Profiler\" tool to see all the requests processed by the server.": { + "message": "Use ", + "comment": [ + "Context: Use \"Profiler\" tool to see all the requests processed by the server." + ] + }, + " tool to see all the requests processed by the server./Context: Use \"Profiler\" tool to see all the requests processed by the server.": { + "message": " tool to see all the requests processed by the server.", + "comment": [ + "Context: Use \"Profiler\" tool to see all the requests processed by the server." + ] + }, + "RedisInsight does not support /Context: RedisInsight does not support \"RESP3\" at the moment, but we are working on it.": { + "message": "RedisInsight does not support ", + "comment": [ + "Context: RedisInsight does not support \"RESP3\" at the moment, but we are working on it." + ] + }, + " at the moment, but we are working on it./Context: RedisInsight does not support \"RESP3\" at the moment, but we are working on it.": { + "message": " at the moment, but we are working on it.", + "comment": [ + "Context: RedisInsight does not support \"RESP3\" at the moment, but we are working on it." + ] + }, "Scan more": "Scan more", "Keys are the foundation of Redis.": "Keys are the foundation of Redis.", "No results found.": "No results found."