Skip to content

Commit

Permalink
Translate the instruction in French for osc-cost
Browse files Browse the repository at this point in the history
Signed-off-by: Maxime Dufour <[email protected]>
  • Loading branch information
outscale-mdr committed Jan 25, 2024
1 parent 6ffa040 commit c4143e5
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 10 deletions.
12 changes: 11 additions & 1 deletion l10n/bundle.l10n.fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
}
18 changes: 9 additions & 9 deletions src/components/osc_cost.ts
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ export async function isOscCostWorking(): Promise<boolean> {
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;
}
Expand All @@ -274,7 +274,7 @@ export async function isOscCostWorking(): Promise<boolean> {
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;
}
);
Expand Down Expand Up @@ -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:
Expand All @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit c4143e5

Please sign in to comment.