Skip to content

Commit dd7d0eb

Browse files
author
Akos Kitta
committed
Fixed missing translations
Aligned the languge pack versions. Closes arduino#1431 Signed-off-by: Akos Kitta <[email protected]>
1 parent 4e590ab commit dd7d0eb

File tree

18 files changed

+235
-349
lines changed

18 files changed

+235
-349
lines changed

Diff for: arduino-ide-extension/src/browser/arduino-ide-frontend-module.ts

-20
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,6 @@ import {
5353
DockPanelRenderer as TheiaDockPanelRenderer,
5454
TabBarRendererFactory,
5555
ContextMenuRenderer,
56-
createTreeContainer,
57-
TreeWidget,
5856
} from '@theia/core/lib/browser';
5957
import { MenuContribution } from '@theia/core/lib/common/menu';
6058
import {
@@ -207,12 +205,8 @@ import { WorkspaceVariableContribution as TheiaWorkspaceVariableContribution } f
207205
import { WorkspaceVariableContribution } from './theia/workspace/workspace-variable-contribution';
208206
import { DebugConfigurationManager } from './theia/debug/debug-configuration-manager';
209207
import { DebugConfigurationManager as TheiaDebugConfigurationManager } from '@theia/debug/lib/browser/debug-configuration-manager';
210-
import { SearchInWorkspaceWidget as TheiaSearchInWorkspaceWidget } from '@theia/search-in-workspace/lib/browser/search-in-workspace-widget';
211-
import { SearchInWorkspaceWidget } from './theia/search-in-workspace/search-in-workspace-widget';
212208
import { SearchInWorkspaceFactory as TheiaSearchInWorkspaceFactory } from '@theia/search-in-workspace/lib/browser/search-in-workspace-factory';
213209
import { SearchInWorkspaceFactory } from './theia/search-in-workspace/search-in-workspace-factory';
214-
import { SearchInWorkspaceResultTreeWidget as TheiaSearchInWorkspaceResultTreeWidget } from '@theia/search-in-workspace/lib/browser/search-in-workspace-result-tree-widget';
215-
import { SearchInWorkspaceResultTreeWidget } from './theia/search-in-workspace/search-in-workspace-result-tree-widget';
216210
import { MonacoEditorProvider } from './theia/monaco/monaco-editor-provider';
217211
import {
218212
MonacoEditorFactory,
@@ -604,9 +598,6 @@ export default new ContainerModule((bind, unbind, isBound, rebind) => {
604598
bind(MonacoEditorProvider).toSelf().inSingletonScope();
605599
rebind(TheiaMonacoEditorProvider).toService(MonacoEditorProvider);
606600

607-
bind(SearchInWorkspaceWidget).toSelf();
608-
rebind(TheiaSearchInWorkspaceWidget).toService(SearchInWorkspaceWidget);
609-
610601
// Disabled reference counter in the editor manager to avoid opening the same editor (with different opener options) multiple times.
611602
bind(EditorManager).toSelf().inSingletonScope();
612603
rebind(TheiaEditorManager).toService(EditorManager);
@@ -616,17 +607,6 @@ export default new ContainerModule((bind, unbind, isBound, rebind) => {
616607
.to(SearchInWorkspaceFactory)
617608
.inSingletonScope();
618609

619-
rebind(TheiaSearchInWorkspaceResultTreeWidget).toDynamicValue(
620-
({ container }) => {
621-
const childContainer = createTreeContainer(container);
622-
childContainer.bind(SearchInWorkspaceResultTreeWidget).toSelf();
623-
childContainer
624-
.rebind(TreeWidget)
625-
.toService(SearchInWorkspaceResultTreeWidget);
626-
return childContainer.get(SearchInWorkspaceResultTreeWidget);
627-
}
628-
);
629-
630610
// Show a disconnected status bar, when the daemon is not available
631611
bind(ApplicationConnectionStatusContribution).toSelf().inSingletonScope();
632612
rebind(TheiaApplicationConnectionStatusContribution).toService(

Diff for: arduino-ide-extension/src/browser/boards/boards-config.tsx

+8-3
Original file line numberDiff line numberDiff line change
@@ -259,9 +259,12 @@ export class BoardsConfig extends React.Component<
259259
override render(): React.ReactNode {
260260
return (
261261
<>
262-
{this.renderContainer('boards', this.renderBoards.bind(this))}
263262
{this.renderContainer(
264-
'ports',
263+
nls.localize('arduino/board/boards', 'boards'),
264+
this.renderBoards.bind(this)
265+
)}
266+
{this.renderContainer(
267+
nls.localize('arduino/board/ports', 'ports'),
265268
this.renderPorts.bind(this),
266269
this.renderPortsFooter.bind(this)
267270
)}
@@ -374,7 +377,9 @@ export class BoardsConfig extends React.Component<
374377
defaultChecked={this.state.showAllPorts}
375378
onChange={this.toggleFilterPorts}
376379
/>
377-
<span>Show all ports</span>
380+
<span>
381+
{nls.localize('arduino/board/showAllPorts', 'Show all ports')}
382+
</span>
378383
</label>
379384
</div>
380385
);

Diff for: arduino-ide-extension/src/browser/contributions/board-selection.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import {
55
DisposableCollection,
66
Disposable,
77
} from '@theia/core/lib/common/disposable';
8-
import { firstToUpperCase } from '../../common/utils';
98
import { BoardsConfig } from '../boards/boards-config';
109
import { MainMenuManager } from '../../common/main-menu-manager';
1110
import { BoardsListWidget } from '../boards/boards-list-widget';
@@ -267,7 +266,11 @@ PID: ${PID}`;
267266
];
268267
const placeholder = new PlaceholderMenuNode(
269268
menuPath,
270-
`${firstToUpperCase(protocol)} ports`,
269+
nls.localize(
270+
'arduino/board/typeOfPorts',
271+
'{0} ports',
272+
Port.Protocols.protocolLabel(protocol)
273+
),
271274
{ order: protocolOrder.toString() }
272275
);
273276
this.menuModelRegistry.registerMenuNode(menuPath, placeholder);

Diff for: arduino-ide-extension/src/browser/dialogs/settings/settings-component.tsx

+18-5
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { FileDialogService } from '@theia/filesystem/lib/browser/file-dialog/fil
1010
import { DisposableCollection } from '@theia/core/lib/common/disposable';
1111
import {
1212
AdditionalUrls,
13+
CompilerWarnings,
1314
CompilerWarningLiterals,
1415
Network,
1516
ProxySettings,
@@ -260,7 +261,7 @@ export class SettingsComponent extends React.Component<
260261
>
261262
{CompilerWarningLiterals.map((value) => (
262263
<option key={value} value={value}>
263-
{value}
264+
{CompilerWarnings.labelOf(value)}
264265
</option>
265266
))}
266267
</select>
@@ -398,10 +399,22 @@ export class SettingsComponent extends React.Component<
398399
</form>
399400
<div className="flex-line proxy-settings">
400401
<div className="column">
401-
<div className="flex-line">Host name:</div>
402-
<div className="flex-line">Port number:</div>
403-
<div className="flex-line">Username:</div>
404-
<div className="flex-line">Password:</div>
402+
<div className="flex-line">{`${nls.localize(
403+
'arduino/preferences/proxySettings/hostname',
404+
'Host name'
405+
)}:`}</div>
406+
<div className="flex-line">{`${nls.localize(
407+
'arduino/preferences/proxySettings/port',
408+
'Port number'
409+
)}:`}</div>
410+
<div className="flex-line">{`${nls.localize(
411+
'arduino/preferences/proxySettings/username',
412+
'Username'
413+
)}:`}</div>
414+
<div className="flex-line">{`${nls.localize(
415+
'arduino/preferences/proxySettings/password',
416+
'Password'
417+
)}:`}</div>
405418
</div>
406419
<div className="column stretch">
407420
<div className="flex-line">

Diff for: arduino-ide-extension/src/browser/serial/plotter/plotter-frontend-contribution.ts

+7-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import {
1818
CLOSE_PLOTTER_WINDOW,
1919
SHOW_PLOTTER_WINDOW,
2020
} from '../../../common/ipc-communication';
21+
import { nls } from '@theia/core/lib/common/nls';
2122

2223
const queryString = require('query-string');
2324

@@ -107,7 +108,12 @@ export class PlotterFrontendContribution extends Contribution {
107108
if (wsPort) {
108109
this.open(wsPort);
109110
} else {
110-
this.messageService.error(`Couldn't open serial plotter`);
111+
this.messageService.error(
112+
nls.localize(
113+
'arduino/contributions/plotter/couldNotOpen',
114+
"Couldn't open serial plotter"
115+
)
116+
);
111117
}
112118
}
113119

Diff for: arduino-ide-extension/src/browser/style/list-widget.css

+4-2
Original file line numberDiff line numberDiff line change
@@ -111,13 +111,15 @@
111111
font-weight: bold;
112112
max-height: calc(1em + 4px);
113113
color: var(--theia-button-foreground);
114-
content: 'INSTALLED';
114+
content: attr(install);
115+
text-transform: uppercase;
115116
}
116117

117118
.component-list-item .header .installed:hover:before {
118119
background-color: var(--theia-button-foreground);
119120
color: var(--theia-button-background);
120-
content: 'UNINSTALL';
121+
content: attr(uninstall);
122+
text-transform: uppercase;
121123
}
122124

123125
.component-list-item[min-width~="170px"] .footer {

Diff for: arduino-ide-extension/src/browser/theia/search-in-workspace/search-in-workspace-result-tree-widget.ts

-44
This file was deleted.

Diff for: arduino-ide-extension/src/browser/theia/search-in-workspace/search-in-workspace-widget.tsx

-80
This file was deleted.

Diff for: arduino-ide-extension/src/browser/widgets/component-list/list-item-renderer.tsx

+8-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,14 @@ export class ListItemRenderer<T extends ArduinoComponent> {
5555
item.installedVersion
5656
)}
5757
</span>
58-
<span className="installed" onClick={onClickUninstall} />
58+
<span
59+
className="installed"
60+
onClick={onClickUninstall}
61+
{...{
62+
install: nls.localize('arduino/component/install', 'INSTALL'),
63+
uninstall: nls.localize('arduino/component/uninstall', 'Uninstall'),
64+
}}
65+
/>
5966
</div>
6067
);
6168

Diff for: arduino-ide-extension/src/common/protocol/boards-service.ts

+23
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,29 @@ export namespace Port {
285285
return false;
286286
};
287287
}
288+
289+
export namespace Protocols {
290+
export const KnownProtocolLiterals = ['serial', 'network'] as const;
291+
export type KnownProtocol = typeof KnownProtocolLiterals[number];
292+
export namespace KnownProtocol {
293+
export function is(protocol: unknown): protocol is KnownProtocol {
294+
return (
295+
typeof protocol === 'string' &&
296+
KnownProtocolLiterals.indexOf(protocol as KnownProtocol) >= 0
297+
);
298+
}
299+
}
300+
export const ProtocolLabels: Record<KnownProtocol, string> = {
301+
serial: nls.localize('arduino/portProtocol/serial', 'Serial'),
302+
network: nls.localize('arduino/portProtocol/network', 'Network'),
303+
};
304+
export function protocolLabel(protocol: string): string {
305+
if (KnownProtocol.is(protocol)) {
306+
return ProtocolLabels[protocol];
307+
}
308+
return protocol;
309+
}
310+
}
288311
}
289312

290313
export interface BoardsPackage extends ArduinoComponent {

Diff for: arduino-ide-extension/src/common/protocol/core-service.ts

+12
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { nls } from '@theia/core/lib/common/nls';
12
import { ApplicationError } from '@theia/core/lib/common/application-error';
23
import type {
34
Location,
@@ -18,6 +19,17 @@ export const CompilerWarningLiterals = [
1819
'All',
1920
] as const;
2021
export type CompilerWarnings = typeof CompilerWarningLiterals[number];
22+
export namespace CompilerWarnings {
23+
export function labelOf(warning: CompilerWarnings): string {
24+
return CompilerWarningLabels[warning];
25+
}
26+
const CompilerWarningLabels: Record<CompilerWarnings, string> = {
27+
None: nls.localize('arduino/core/compilerWarnings/none', 'None'),
28+
Default: nls.localize('arduino/core/compilerWarnings/default', 'Default'),
29+
More: nls.localize('arduino/core/compilerWarnings/more', 'More'),
30+
All: nls.localize('arduino/core/compilerWarnings/all', 'All'),
31+
};
32+
}
2133
export namespace CoreError {
2234
export interface ErrorLocationRef {
2335
readonly message: string;

0 commit comments

Comments
 (0)