From 650f622ee6434ae64eb9cf6486bd0eeff08fa320 Mon Sep 17 00:00:00 2001 From: Maxime Dufour Date: Thu, 25 Jan 2024 08:49:46 +0000 Subject: [PATCH] Translate the instruction in French for osc-cost Signed-off-by: Maxime Dufour --- l10n/bundle.l10n.fr.json | 12 +++++++++++- src/components/osc_cost.ts | 18 +++++++++--------- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/l10n/bundle.l10n.fr.json b/l10n/bundle.l10n.fr.json index c979b38..d1ff864 100644 --- a/l10n/bundle.l10n.fr.json +++ b/l10n/bundle.l10n.fr.json @@ -54,5 +54,15 @@ "Get": "Récupération", "Select the private key used for decrypting the admin password": "Sélectionnez la clé privée pour déchiffrer le mot de passe administrateur", "Cannot retrieve the admin password": "Impossible de récupérer le mot de passe administrateur", - "Decryption fails ({0})": "Echec du déchiffrement ({0})" + "Decryption fails ({0})": "Echec du déchiffrement ({0})", + "No, open the documentation": "Lire la documentation", + "Installing {0}": "Installation de {0}", + "Installing the latest stable version of {0}": "Installation de la dernière version de {0}", + "Error while installing {0}: {1}": "Erreur lors de l'installation de {0}: {1}", + "{0} is not found": "{0} est introuvable", + "Error while retrieving the version of {0}: {1}": "Erreur lors de la récupération de la version de {0}: {1}", + "Downloading {0} for {1}, {2} in {3}": "Téléchargement de {0} pour {1}, {2} dans {3}", + "{0} is not found. Do you want to install it ?": "{0} est introuvable. Voulez-vous l'installer ?", + "Adding the path to the user config": "Ajout du chemin dans la configuration utilisateur", + "Latest stable version found is {0}": "La dernière version stable trouvée est {0}" } \ No newline at end of file diff --git a/src/components/osc_cost.ts b/src/components/osc_cost.ts index 714e32a..010bb6e 100644 --- a/src/components/osc_cost.ts +++ b/src/components/osc_cost.ts @@ -264,7 +264,7 @@ export async function isOscCostWorking(): Promise { const oscCostPath = getOscCostPath(); if (typeof oscCostPath === 'undefined') { - vscode.window.showInformationMessage(vscode.l10n.t(`osc-cost binary is not found`)); + vscode.window.showErrorMessage(vscode.l10n.t("{0} is not found", "osc-cost")); showErrorMessageWithInstallPrompt(); return false; } @@ -274,7 +274,7 @@ export async function isOscCostWorking(): Promise { return true; }, (reason) => { - vscode.window.showErrorMessage(vscode.l10n.t(`osc-cost binary is found but it fails with: ${reason}`)); + vscode.window.showErrorMessage(vscode.l10n.t("Error while retrieving the version of {0}: {1}", "osc-cost", reason)); return false; } ); @@ -325,11 +325,11 @@ function getDefaultOptions(version: string): string | undefined { } export async function showErrorMessageWithInstallPrompt() { - const message = vscode.l10n.t("osc-cost is not found. Do you want to install it ?"); - const yes = vscode.l10n.t('Yes'); - const noManually = vscode.l10n.t('No, manually'); - const no = vscode.l10n.t('No at all'); const tool = "osc-cost"; + const message = vscode.l10n.t("{0} is not found. Do you want to install it ?", tool); + const yes = vscode.l10n.t('Yes'); + const noManually = vscode.l10n.t('No, open the documentation'); + const no = vscode.l10n.t('No'); const choice = await vscode.window.showErrorMessage(message, yes, noManually, no); switch (choice) { case no: @@ -341,13 +341,13 @@ export async function showErrorMessageWithInstallPrompt() { // Install and update the path await vscode.window.withProgress( { - title: vscode.l10n.t("Installing osc-cost"), + title: vscode.l10n.t("Installing {0}", tool), location: vscode.ProgressLocation.Notification, cancellable: false }, // eslint-disable-next-line @typescript-eslint/no-unused-vars async (p, _) => { - p.report({ message: vscode.l10n.t("Installing the latest stable version of osc-cost") }); + p.report({ message: vscode.l10n.t("Installing the latest stable version of {0}", tool) }); await installOscCost(p).catch((reason: string) => { vscode.window.showErrorMessage(vscode.l10n.t("Error while installing {0}: {1}", tool, reason)); throw vscode.l10n.t("Error while installing {0}: {1}", tool, reason); @@ -431,7 +431,7 @@ async function installOscCost(p?: vscode.Progress<{ message?: string; increment? const downloadUrl = `https://github.com/outscale/osc-cost/releases/download/${version}/${tool}-${version}-${arch}-${targetOs}${extension}`; const downloadFile = path.join(targetDir, binName); - p?.report({ message: vscode.l10n.t("Downloading osc-cost for {0} {1} in {2}", platform, arch, downloadFile) }); + p?.report({ message: vscode.l10n.t("Downloading {0} for {1}, {2} in {3}", tool, targetOs, arch, downloadFile) }); const stream = fs.createWriteStream(downloadFile); const res = await fetch(downloadUrl);