From 26d861f87349a09c2411ae51bbba3e23204d54c5 Mon Sep 17 00:00:00 2001 From: Fernando Dodino Date: Mon, 7 Oct 2024 23:37:55 -0300 Subject: [PATCH] i18n extension texts --- packages/client/src/commands.ts | 7 +++---- packages/client/src/extension.ts | 5 +++-- packages/client/src/messages.ts | 14 ++++++++++---- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/packages/client/src/commands.ts b/packages/client/src/commands.ts index ea0c6fa..44c1fc1 100644 --- a/packages/client/src/commands.ts +++ b/packages/client/src/commands.ts @@ -9,14 +9,13 @@ import { window, workspace, } from 'vscode' +import { DEFAULT_GAME_PORT, DEFAULT_REPL_PORT } from '../../server/src/settings' import { asShellString, fsToShell, } from './platform-string-utils' import { COMMAND_RUN_ALL_TESTS, COMMAND_RUN_GAME, COMMAND_RUN_PROGRAM, COMMAND_RUN_TEST, COMMAND_START_REPL, wollokLSPExtensionCode, COMMAND_INIT_PROJECT } from './shared-definitions' -import { DEFAULT_REPL_PORT, DEFAULT_GAME_PORT } from '../../server/src/settings' -import { getMessage } from 'wollok-ts' -import { lang, lspClientMessages } from './messages' +import { getLSPMessage } from './messages' export const subscribeWollokCommands = (context: ExtensionContext): void => { context.subscriptions.push(registerCLICommand(COMMAND_START_REPL, startRepl)) @@ -124,7 +123,7 @@ const wollokCLITask = (task: string, name: string, cliCommands: Array { if (progress.kind === 'begin' || progress.kind === 'report') { - statusBarItem.text = '$(loading~spin) Wollok Building...' + statusBarItem.text = '$(loading~spin) ' + getLSPMessage('wollokBuilding') statusBarItem.show() } else { statusBarItem.hide() diff --git a/packages/client/src/messages.ts b/packages/client/src/messages.ts index 8f300ca..ecb5e86 100644 --- a/packages/client/src/messages.ts +++ b/packages/client/src/messages.ts @@ -1,4 +1,6 @@ -import { LANGUAGES, Messages } from 'wollok-ts' +import { getMessage, LANGUAGES, Messages } from 'wollok-ts' +import { wollokLSPExtensionCode } from './shared-definitions' +import { workspace } from 'vscode' export const languageDescription: { [key: string]: LANGUAGES } = { Spanish: LANGUAGES.SPANISH, @@ -9,9 +11,13 @@ export const lang = (selectedLanguage: string): LANGUAGES => languageDescription export const lspClientMessages: Messages = { [LANGUAGES.ENGLISH]: { - missingWollokCliPath: 'Falta configurar la ruta donde está instalado wollok-ts-cli. Este paso es necesario para ejecutar cualquier comando de Wollok.', + missingWollokCliPath: 'Missing configuration WollokLSP/cli-path. Set the path where wollok-ts-cli is located in order to run Wollok tasks', + wollokBuilding: 'Wollok Building...', }, [LANGUAGES.SPANISH]: { - missingWollokCliPath: 'Missing configuration WollokLSP/cli-path. Set the path where wollok-ts-cli is located in order to run Wollok tasks', + missingWollokCliPath: 'Falta configurar la ruta donde está instalado wollok-ts-cli. Este paso es necesario para ejecutar cualquier comando de Wollok.', + wollokBuilding: 'Generando Wollok...', }, -} \ No newline at end of file +} + +export const getLSPMessage = (message: string): string => getMessage({ message, language: lang(workspace.getConfiguration(wollokLSPExtensionCode).get('language')), customMessages: lspClientMessages }) \ No newline at end of file