Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
yevheniyJ committed Feb 19, 2024
1 parent fe4ec01 commit b1ae671
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions src/client/crowdinClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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)}`
);
}
Expand Down

0 comments on commit b1ae671

Please sign in to comment.