Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nls: add missing localization when preparing the download #11988

Closed
vince-fugnitto opened this issue Dec 13, 2022 · 1 comment
Closed

nls: add missing localization when preparing the download #11988

vince-fugnitto opened this issue Dec 13, 2022 · 1 comment
Labels
localization issues related to localization/internalization/nls

Comments

@vince-fugnitto
Copy link
Member

Bug Description:

The download command is missing a localization when displaying progress regarding preparing the download:

async download(uris: URI[], options?: FileDownloadService.DownloadOptions): Promise<void> {
let cancel = false;
if (uris.length === 0) {
return;
}
const copyLink = options && options.copyLink ? true : false;
try {
const [progress, result] = await Promise.all([
this.messageService.showProgress({
text: `Preparing download${copyLink ? ' link' : ''}...`, options: { cancelable: true }
}, () => { cancel = true; }),

We should properly localize the text as follows:

try {
+   const text = copyLink ?
+       nls.localize('theia/filesystem/prepareDownloadLink', 'Preparing download link...') :
+       nls.localize('theia/filesystem/prepareDownload', 'Preparing download...');
    const [progress, result] = await Promise.all([
        this.messageService.showProgress({
-           text: `Preparing download${copyLink ? ' link' : ''}...`, options: { cancelable: true }
+           text, options: { cancelable: true }
        }, () => { cancel = true; }),

In addition, the default localization for the ProgressMessage.Cancel is missing:

export namespace ProgressMessage {
export const Cancel = 'Cancel';

- export const Cancel = 'Cancel';
+ export const Cancel = nls.localizeByDefault('Cancel');

Steps to Reproduce:

  1. start the browser application (the download command is not available on electron) with theia as a workpace
  2. execute F1 > Configure Display Language, install a new language-pack, and restart the application
  3. open the explorer
  4. attempt to download a big resource (ex: node_modules) by right-clicking the directory and choosing the "download" command (will be localized)
  5. confirm that the progress notification is not localized
Video
download-progress.mov
@vince-fugnitto vince-fugnitto added the localization issues related to localization/internalization/nls label Dec 13, 2022
@vince-fugnitto
Copy link
Member Author

Closed by #11988.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
localization issues related to localization/internalization/nls
Projects
None yet
Development

No branches or pull requests

1 participant