From b1ae671d2a7fa09fa355e6bad523dc839e122e73 Mon Sep 17 00:00:00 2001 From: Yevheniy Oliynyk Date: Mon, 19 Feb 2024 13:38:19 +0200 Subject: [PATCH] fixes --- src/client/crowdinClient.ts | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/client/crowdinClient.ts b/src/client/crowdinClient.ts index d278fcd..762c96d 100644 --- a/src/client/crowdinClient.ts +++ b/src/client/crowdinClient.ts @@ -102,10 +102,23 @@ export class CrowdinClient { }); if (downloadedTranslationFiles.length > 0 && filesToUnzip.length === 0) { - ErrorHandler.handleError("Downloaded translations don't match the current project configuration. The translations for the following sources will be omitted"); + vscode.window.showWarningMessage( + "Downloaded translations don't match the current project configuration. The translations for the following sources will be omitted" + ); return; } + const omittedFiles = downloadedTranslationFiles + .map((file) => file.entryName) + .filter((entryName) => !filesToUnzip.some((entry) => entry.entryName === entryName)); + + if (omittedFiles.length > 0) { + vscode.window.showWarningMessage( + 'Due to missing respective sources, the following translations will be omitted: ' + + omittedFiles.join(', ') + ); + } + filesToUnzip.forEach((file) => { const filePath = path.join(unzipFolder, file.entryName); const directory = path.dirname(filePath); @@ -456,7 +469,8 @@ export class CrowdinClient { } } catch (error) { throw new Error( - `Failed to create/update file ${path.basename(file)} for project ${this.projectId + `Failed to create/update file ${path.basename(file)} for project ${ + this.projectId }. ${this.getErrorMessage(error)}` ); }