Translating Arduino-IDE using Theia's nls API (#545)

This commit is contained in:
Mark Sujew
2021-10-18 09:59:33 +02:00
committed by GitHub
parent 61262c23ac
commit 11b75bd610
76 changed files with 1445 additions and 499 deletions

View File

@@ -1,15 +1,21 @@
import { Command } from '@theia/core/lib/common/command';
export namespace SketchbookCommands {
export const OPEN_NEW_WINDOW: Command = {
id: 'arduino-sketchbook--open-sketch-new-window',
label: 'Open Sketch in New Window',
};
export const OPEN_NEW_WINDOW = Command.toLocalizedCommand(
{
id: 'arduino-sketchbook--open-sketch-new-window',
label: 'Open Sketch in New Window',
},
'arduino/sketch/openSketchInNewWindow'
);
export const REVEAL_IN_FINDER: Command = {
id: 'arduino-sketchbook--reveal-in-finder',
label: 'Open Folder',
};
export const REVEAL_IN_FINDER = Command.toLocalizedCommand(
{
id: 'arduino-sketchbook--reveal-in-finder',
label: 'Open Folder',
},
'arduino/sketch/openFolder'
);
export const OPEN_SKETCHBOOK_CONTEXT_MENU: Command = {
id: 'arduino-sketchbook--open-sketch-context-menu',

View File

@@ -17,6 +17,7 @@ import { ArduinoPreferences } from '../../arduino-preferences';
import { SketchesServiceClientImpl } from '../../../common/protocol/sketches-service-client-impl';
import { SelectableTreeNode } from '@theia/core/lib/browser/tree/tree-selection';
import { Sketch } from '../../contributions/contribution';
import { nls } from '@theia/core/lib/browser/nls';
@injectable()
export class SketchbookTreeWidget extends FileTreeWidget {
@@ -41,7 +42,10 @@ export class SketchbookTreeWidget extends FileTreeWidget {
super(props, model, contextMenuRenderer);
this.id = 'arduino-sketchbook-tree-widget';
this.title.iconClass = 'sketchbook-tree-icon';
this.title.caption = 'Local Sketchbook';
this.title.caption = nls.localize(
'arduino/sketch/titleLocalSketchbook',
'Local Sketchbook'
);
this.title.closable = false;
}

View File

@@ -69,7 +69,7 @@ export class SketchbookWidgetContribution
constructor() {
super({
widgetId: 'arduino-sketchbook-widget',
widgetName: 'Sketchbook',
widgetName: SketchbookWidget.LABEL,
defaultWidgetOptions: {
area: 'left',
rank: 1,

View File

@@ -6,9 +6,12 @@ import { Message, MessageLoop } from '@phosphor/messaging';
import { Disposable } from '@theia/core/lib/common/disposable';
import { BaseWidget } from '@theia/core/lib/browser/widgets/widget';
import { SketchbookTreeWidget } from './sketchbook-tree-widget';
import { nls } from '@theia/core/lib/browser/nls';
@injectable()
export class SketchbookWidget extends BaseWidget {
static LABEL = nls.localize('arduino/sketch/titleSketchbook', 'Sketchbook');
@inject(SketchbookTreeWidget)
protected readonly localSketchbookTreeWidget: SketchbookTreeWidget;
@@ -17,8 +20,8 @@ export class SketchbookWidget extends BaseWidget {
constructor() {
super();
this.id = 'arduino-sketchbook-widget';
this.title.caption = 'Sketchbook';
this.title.label = 'Sketchbook';
this.title.caption = SketchbookWidget.LABEL;
this.title.label = SketchbookWidget.LABEL;
this.title.iconClass = 'fa fa-arduino-folder';
this.title.closable = true;
this.node.tabIndex = 0;