Skip to content

Commit

Permalink
Add translation in buttons (#10564)
Browse files Browse the repository at this point in the history
Signed-off-by: shuyaqian 717749594@qq.com
  • Loading branch information
shuyaqian authored Dec 22, 2021
1 parent ca75bbb commit a59118d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions packages/filesystem/src/browser/file-dialog/file-dialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

import { injectable, inject, postConstruct } from '@theia/core/shared/inversify';
import { Message } from '@theia/core/shared/@phosphor/messaging';
import { Disposable, MaybeArray } from '@theia/core/lib/common';
import { Disposable, MaybeArray, nls } from '@theia/core/lib/common';
import { AbstractDialog, DialogProps, setEnabled, createIconButton, Widget, codiconArray, Key, LabelProvider } from '@theia/core/lib/browser';
import { FileStatNode } from '../file-tree';
import { LocationListRenderer, LocationListRendererFactory } from '../location';
Expand Down Expand Up @@ -244,7 +244,7 @@ export abstract class FileDialog<T> extends AbstractDialog<T> {

this.appendFiltersPanel();

this.appendCloseButton('Cancel');
this.appendCloseButton(nls.localizeByDefault('Cancel'));
this.appendAcceptButton(this.getAcceptButtonLabel());

this.addKeyListener(this.back, Key.ENTER, () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ class OpenHostedInstanceLinkDialog extends AbstractDialog<string> {
this.contentNode.appendChild(messageNode);

this.appendCloseButton();
this.openButton = this.appendAcceptButton('Open');
this.openButton = this.appendAcceptButton(nls.localizeByDefault('Open'));
}

showOpenNewTabAskDialog(uri: string): void {
Expand Down
3 changes: 2 additions & 1 deletion packages/plugin-ext/src/main/browser/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { Command, CommandService } from '@theia/core/lib/common/command';
import { AbstractDialog } from '@theia/core/lib/browser';
import { WindowService } from '@theia/core/lib/browser/window/window-service';
import * as DOMPurify from '@theia/core/shared/dompurify';
import { nls } from '@theia/core/lib/common/nls';

@injectable()
export class OpenUriCommandHandler {
Expand Down Expand Up @@ -85,7 +86,7 @@ class OpenNewTabDialog extends AbstractDialog<string> {
this.contentNode.appendChild(messageNode);

this.appendCloseButton();
this.openButton = this.appendAcceptButton('Open');
this.openButton = this.appendAcceptButton(nls.localizeByDefault('Open'));
}

showOpenNewTabDialog(uri: string): void {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { AbstractDialog } from '@theia/core/lib/browser/dialogs';
import '../../../../src/main/browser/dialogs/style/modal-notification.css';
import { MainMessageItem, MainMessageOptions } from '../../../common/plugin-api-rpc';
import { FrontendApplicationConfigProvider } from '@theia/core/lib/browser/frontend-application-config-provider';
import { nls } from '@theia/core/lib/common/nls';

export enum MessageType {
Error = 'error',
Expand Down Expand Up @@ -91,7 +92,7 @@ export class ModalNotification extends AbstractDialog<string | undefined> {
if (actions.length <= 0) {
this.appendAcceptButton();
} else if (!actions.some(action => action.isCloseAffordance === true)) {
this.appendCloseButton('Close');
this.appendCloseButton(nls.localizeByDefault('Close'));
}

return messageNode;
Expand Down

0 comments on commit a59118d

Please sign in to comment.