Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit e99a0f5

Browse files
author
Akos Kitta
committedSep 21, 2022
Fixed missing translations
Aligned the languge pack versions. Closes #1431 Signed-off-by: Akos Kitta <[email protected]>
1 parent 6983c5b commit e99a0f5

File tree

18 files changed

+235
-349
lines changed

18 files changed

+235
-349
lines changed
 

‎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,
@@ -605,9 +599,6 @@ export default new ContainerModule((bind, unbind, isBound, rebind) => {
605599
bind(MonacoEditorProvider).toSelf().inSingletonScope();
606600
rebind(TheiaMonacoEditorProvider).toService(MonacoEditorProvider);
607601

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

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

‎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
)}
@@ -384,7 +387,9 @@ export class BoardsConfig extends React.Component<
384387
defaultChecked={this.state.showAllPorts}
385388
onChange={this.toggleFilterPorts}
386389
/>
387-
<span>Show all ports</span>
390+
<span>
391+
{nls.localize('arduino/board/showAllPorts', 'Show all ports')}
392+
</span>
388393
</label>
389394
</div>
390395
);

‎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);

‎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">

‎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

‎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 {

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

-44
This file was deleted.

‎arduino-ide-extension/src/browser/theia/search-in-workspace/search-in-workspace-widget.tsx

-80
This file was deleted.

‎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

‎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 {

‎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;

‎arduino-ide-extension/src/node/i18n/arduino-localization-contribution.ts

+34-139
Original file line numberDiff line numberDiff line change
@@ -3,150 +3,45 @@ import {
33
LocalizationRegistry,
44
} from '@theia/core/lib/node/i18n/localization-contribution';
55
import { injectable } from '@theia/core/shared/inversify';
6+
import { join } from 'path';
67

78
@injectable()
89
export class ArduinoLocalizationContribution
910
implements LocalizationContribution
1011
{
11-
async registerLocalizations(registry: LocalizationRegistry): Promise<void> {
12-
registry.registerLocalizationFromRequire(
13-
'af',
14-
require('../../../build/i18n/af.json')
15-
);
16-
17-
registry.registerLocalizationFromRequire(
18-
'en',
19-
require('../../../build/i18n/en.json')
20-
);
21-
22-
registry.registerLocalizationFromRequire(
23-
'fr',
24-
require('../../../build/i18n/fr.json')
25-
);
26-
27-
registry.registerLocalizationFromRequire(
28-
'ko',
29-
require('../../../build/i18n/ko.json')
30-
);
31-
32-
registry.registerLocalizationFromRequire(
33-
'pt-br',
34-
require('../../../build/i18n/pt.json')
35-
);
36-
37-
registry.registerLocalizationFromRequire(
38-
'uk_UA',
39-
require('../../../build/i18n/uk_UA.json')
40-
);
41-
42-
registry.registerLocalizationFromRequire(
43-
'ar',
44-
require('../../../build/i18n/ar.json')
45-
);
46-
47-
registry.registerLocalizationFromRequire(
48-
'es',
49-
require('../../../build/i18n/es.json')
50-
);
51-
52-
registry.registerLocalizationFromRequire(
53-
'he',
54-
require('../../../build/i18n/he.json')
55-
);
56-
57-
registry.registerLocalizationFromRequire(
58-
'my_MM',
59-
require('../../../build/i18n/my_MM.json')
60-
);
61-
62-
registry.registerLocalizationFromRequire(
63-
'ro',
64-
require('../../../build/i18n/ro.json')
65-
);
66-
67-
registry.registerLocalizationFromRequire(
68-
'zh-cn',
69-
require('../../../build/i18n/zh.json')
70-
);
71-
72-
registry.registerLocalizationFromRequire(
73-
'bg',
74-
require('../../../build/i18n/bg.json')
75-
);
76-
77-
registry.registerLocalizationFromRequire(
78-
'eu',
79-
require('../../../build/i18n/eu.json')
80-
);
12+
// 0. index: locale
13+
// 1. index: optional JSON file to `require` (if differs from the locale)
14+
// If you touch the locales, please keep the alphabetical order. Also in the `package.json` for the VS Code language packs. Thank you! ❤️
15+
// Note that IDE2 has more translations than available VS Code language packs. (https://github.com/arduino/arduino-ide/issues/1447)
16+
private readonly locales: ReadonlyArray<[string, string?]> = [
17+
['bg'],
18+
['cs'],
19+
['de'],
20+
['es'],
21+
['fr'],
22+
['hu'],
23+
// ['id'], Does not have Transifex translations, but has a VS Code language pack available on Open VSX.
24+
['it'],
25+
['ja'],
26+
['ko'],
27+
['nl'],
28+
['pt-br', 'pt'],
29+
['pl', 'pl'],
30+
['ru'],
31+
['tr'],
32+
['uk', 'uk_UA'],
33+
['zh-cn', 'zh'],
34+
];
8135

82-
registry.registerLocalizationFromRequire(
83-
'hu',
84-
require('../../../build/i18n/hu.json')
85-
);
86-
87-
registry.registerLocalizationFromRequire(
88-
'ne',
89-
require('../../../build/i18n/ne.json')
90-
);
91-
92-
registry.registerLocalizationFromRequire(
93-
'ru',
94-
require('../../../build/i18n/ru.json')
95-
);
96-
97-
registry.registerLocalizationFromRequire(
98-
'zh_TW',
99-
require('../../../build/i18n/zh_TW.json')
100-
);
101-
102-
registry.registerLocalizationFromRequire(
103-
'de',
104-
require('../../../build/i18n/de.json')
105-
);
106-
107-
registry.registerLocalizationFromRequire(
108-
'fa',
109-
require('../../../build/i18n/fa.json')
110-
);
111-
112-
registry.registerLocalizationFromRequire(
113-
'it',
114-
require('../../../build/i18n/it.json')
115-
);
116-
117-
registry.registerLocalizationFromRequire(
118-
'nl',
119-
require('../../../build/i18n/nl.json')
120-
);
121-
122-
registry.registerLocalizationFromRequire(
123-
'sv_SE',
124-
require('../../../build/i18n/sv_SE.json')
125-
);
126-
127-
registry.registerLocalizationFromRequire(
128-
'el',
129-
require('../../../build/i18n/el.json')
130-
);
131-
132-
registry.registerLocalizationFromRequire(
133-
'fil',
134-
require('../../../build/i18n/fil.json')
135-
);
136-
137-
registry.registerLocalizationFromRequire(
138-
'ja',
139-
require('../../../build/i18n/ja.json')
140-
);
141-
142-
registry.registerLocalizationFromRequire(
143-
'pl',
144-
require('../../../build/i18n/pl.json')
145-
);
146-
147-
registry.registerLocalizationFromRequire(
148-
'tr',
149-
require('../../../build/i18n/tr.json')
150-
);
36+
async registerLocalizations(registry: LocalizationRegistry): Promise<void> {
37+
for (const [locale, jsonFilename] of this.locales) {
38+
registry.registerLocalizationFromRequire(
39+
locale,
40+
require(join(
41+
__dirname,
42+
`../../../build/i18n/${jsonFilename ?? locale}.json`
43+
))
44+
);
45+
}
15146
}
15247
}

‎arduino-ide-extension/src/node/i18n/localization-backend-contribution.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ export class LocalizationBackendContribution extends TheiaLocalizationBackendCon
2323
app.get('/i18n/:locale', async (req, res) => {
2424
let locale = req.params.locale;
2525
/*
26-
Waiting for the deploy of the language plugins is neecessary to avoid checking the available
27-
languages before they're finished to be loaded: https://github.com/eclipse-theia/theia/issues/11471
26+
Waiting for the deploy of the language plugins is necessary to avoid checking the available
27+
languages before they're finished to be loaded: https://github.com/eclipse-theia/theia/issues/11471
2828
*/
2929
const start = performance.now();
3030
await this.initialized.promise;

‎electron-app/patch/frontend/index.js

+54-2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,53 @@ const {
1717
FrontendApplicationConfigProvider,
1818
} = require('@theia/core/lib/browser/frontend-application-config-provider');
1919

20+
function fetchFrom(path) {
21+
const { Endpoint } = require('@theia/core/lib/browser/endpoint');
22+
const endpoint = new Endpoint({ path }).getRestUrl().toString();
23+
return fetch(endpoint);
24+
}
25+
26+
async function loadTranslations() {
27+
const { nls } = require('@theia/core/lib/common/nls');
28+
const defaultLocale = typeof window === 'object' && window && window.localStorage.getItem(nls.localeId) || '';
29+
if (defaultLocale && !nls.locale) {
30+
Object.assign(nls, {
31+
locale: defaultLocale
32+
});
33+
}
34+
if (nls.locale) {
35+
const response = await fetchFrom(`/i18n/${nls.locale}`);
36+
nls.localization = await response.json();
37+
}
38+
}
39+
40+
async function loadBackendOS() {
41+
const response = await fetchFrom('/os');
42+
const osType = await response.text();
43+
const isWindows = osType === 'Windows';
44+
const isOSX = osType === 'OSX';
45+
OS.backend.isOSX = isOSX;
46+
OS.backend.isWindows = isWindows;
47+
OS.backend.type = () => osType;
48+
}
49+
50+
function customizeMonacoNls() {
51+
const MonacoNls = require('@theia/monaco-editor-core/esm/vs/nls');
52+
const { nls: TheiaNls } = require('@theia/core/lib/common/nls');
53+
const { Localization } = require('@theia/core/lib/common/i18n/localization');
54+
Object.assign(MonacoNls, {
55+
localize(_, label, ...args) {
56+
if (TheiaNls.locale) {
57+
const defaultKey = TheiaNls.getDefaultKey(label);
58+
if (defaultKey) {
59+
return TheiaNls.localize(defaultKey, label, ...args);
60+
}
61+
}
62+
return Localization.format(label, args);
63+
}
64+
});
65+
}
66+
2067
// It is a mighty hack to support theme updates in the bundled IDE2.
2168
// If the custom theme registration happens before the restoration of the existing monaco themes, then any custom theme changes will be ignored.
2269
// This patch introduces a static deferred promise in the monaco-theming service that will be resolved when the restoration is ready.
@@ -25,8 +72,14 @@ const {
2572
// This patch customizes the monaco theme service behavior before loading the DI containers via the preload.
2673
// The preload is called only once before the app loads. The Theia extensions are not loaded at that point, but the app config provider is ready.
2774
const preloader = require('@theia/core/lib/browser/preloader');
28-
const originalPreload = preloader.preload;
2975
preloader.preload = async function () {
76+
// Must require the monaco frontend module to activate the NLS customization for monaco.
77+
// Otherwise, the NLS customization would trigger after the monaco UI components with all their translations are already loaded.
78+
await Promise.allSettled([
79+
loadTranslations(),
80+
loadBackendOS(),
81+
]);
82+
customizeMonacoNls();
3083
const { MonacoThemingService } = require('@theia/monaco/lib/browser/monaco-theming-service');
3184
const { MonacoThemeServiceIsReady } = require('arduino-ide-extension/lib/browser/utils/window');
3285
const { Deferred } = require('@theia/core/lib/common/promise-util');
@@ -42,7 +95,6 @@ preloader.preload = async function () {
4295
await this.restore();
4396
ready.resolve();
4497
}.bind(MonacoThemingService);
45-
return originalPreload();
4698
}.bind(preloader);
4799

48100
const lightTheme = 'arduino-theme';

‎electron/build/template-package.json

-19
Original file line numberDiff line numberDiff line change
@@ -137,24 +137,5 @@
137137
"path": "arduino-ide/nightly"
138138
}
139139
]
140-
},
141-
"theiaPluginsDir": "plugins",
142-
"theiaPlugins": {
143-
"vscode-builtin-cpp": "https://open-vsx.org/api/vscode/cpp/1.52.1/file/vscode.cpp-1.52.1.vsix",
144-
"vscode-arduino-tools": "https://downloads.arduino.cc/vscode-arduino-tools/vscode-arduino-tools-0.0.2-beta.5.vsix",
145-
"vscode-builtin-json": "https://open-vsx.org/api/vscode/json/1.46.1/file/vscode.json-1.46.1.vsix",
146-
"vscode-builtin-json-language-features": "https://open-vsx.org/api/vscode/json-language-features/1.46.1/file/vscode.json-language-features-1.46.1.vsix",
147-
"cortex-debug": "https://open-vsx.org/api/marus25/cortex-debug/0.3.10/file/marus25.cortex-debug-0.3.10.vsix",
148-
"vscode-language-pack-nl": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-nl/1.48.3/file/MS-CEINTL.vscode-language-pack-nl-1.48.3.vsix",
149-
"vscode-language-pack-fr": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-fr/1.69.0/file/MS-CEINTL.vscode-language-pack-fr-1.69.0.vsix",
150-
"vscode-language-pack-zh-hans": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-zh-hans/1.69.0/file/MS-CEINTL.vscode-language-pack-zh-hans-1.69.0.vsix",
151-
"vscode-language-pack-de": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-de/1.69.0/file/MS-CEINTL.vscode-language-pack-de-1.69.0.vsix",
152-
"vscode-language-pack-ja": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-ja/1.69.0/file/MS-CEINTL.vscode-language-pack-ja-1.69.0.vsix",
153-
"vscode-language-pack-tr": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-tr/1.69.0/file/MS-CEINTL.vscode-language-pack-tr-1.69.0.vsix",
154-
"vscode-language-pack-it": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-it/1.69.0/file/MS-CEINTL.vscode-language-pack-it-1.69.0.vsix",
155-
"vscode-language-pack-ru":"https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-ru/1.69.0/file/MS-CEINTL.vscode-language-pack-ru-1.69.0.vsix",
156-
"vscode-language-pack-es": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-es/1.69.0/file/MS-CEINTL.vscode-language-pack-es-1.69.0.vsix",
157-
"vscode-language-pack-pt-BR": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-pt-BR/1.69.0/file/MS-CEINTL.vscode-language-pack-pt-BR-1.69.0.vsix",
158-
"vscode-language-pack-cs": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-cs/1.69.0/file/MS-CEINTL.vscode-language-pack-cs-1.69.0.vsix"
159140
}
160141
}

‎electron/packager/index.js

+19-18
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,8 @@
123123
// Save some time: no need to build the projects that are not needed in final app. Currently unused. |
124124
//---------------------------------------------------------------------------------------------------+
125125
//@ts-ignore
126-
let pkg = require('../working-copy/package.json');
127-
const workspaces = pkg.workspaces;
126+
const rootPackageJson = require('../working-copy/package.json');
127+
const workspaces = rootPackageJson.workspaces;
128128
// We cannot remove the `electron-app`. Otherwise, there is not way to collect the unused dependencies.
129129
const dependenciesToRemove = [];
130130
for (const dependencyToRemove of dependenciesToRemove) {
@@ -133,10 +133,10 @@
133133
workspaces.splice(index, 1);
134134
}
135135
}
136-
pkg.workspaces = workspaces;
136+
rootPackageJson.workspaces = workspaces;
137137
fs.writeFileSync(
138138
path('..', workingCopy, 'package.json'),
139-
JSON.stringify(pkg, null, 2)
139+
JSON.stringify(rootPackageJson, null, 2)
140140
);
141141

142142
//-------------------------------------------------------------------------------------------------+
@@ -169,13 +169,13 @@
169169
if (extension !== 'arduino-ide-extension') {
170170
// Do not unlink self.
171171
// @ts-ignore
172-
pkg = require(`../working-copy/${extension}/package.json`);
172+
rootPackageJson = require(`../working-copy/${extension}/package.json`);
173173
// @ts-ignore
174-
pkg.dependencies['arduino-ide-extension'] =
174+
rootPackageJson.dependencies['arduino-ide-extension'] =
175175
'file:../arduino-ide-extension';
176176
fs.writeFileSync(
177177
path('..', workingCopy, extension, 'package.json'),
178-
JSON.stringify(pkg, null, 2)
178+
JSON.stringify(rootPackageJson, null, 2)
179179
);
180180
}
181181
}
@@ -184,7 +184,7 @@
184184
// Merge the `working-copy/package.json` with `electron/build/template-package.json`. |
185185
//------------------------------------------------------------------------------------+
186186
// @ts-ignore
187-
pkg = require('../working-copy/electron-app/package.json');
187+
const appPackageJson = require('../working-copy/electron-app/package.json');
188188
template.build.files = [
189189
...template.build.files,
190190
...unusedDependencies.map((name) => `!node_modules/${name}`),
@@ -195,25 +195,26 @@
195195
dependencies[extension] = `file:../working-copy/${extension}`;
196196
}
197197
// @ts-ignore
198-
pkg.dependencies = { ...pkg.dependencies, ...dependencies };
199-
pkg.devDependencies = { ...pkg.devDependencies, ...template.devDependencies };
200-
// Deep-merging the Theia application configuration. We enable the electron window reload in dev mode but not for the final product. (arduino/arduino-pro-ide#187)
198+
appPackageJson.dependencies = { ...appPackageJson.dependencies, ...dependencies };
199+
appPackageJson.devDependencies = { ...appPackageJson.devDependencies, ...template.devDependencies };
200+
// Deep-merging the Theia application configuration.
201201
// @ts-ignore
202-
const theia = merge(pkg.theia || {}, template.theia || {});
202+
const theia = merge(appPackageJson.theia || {}, template.theia || {});
203203
const content = {
204-
...pkg,
204+
...appPackageJson,
205205
...template,
206206
theia,
207207
// @ts-ignore
208-
dependencies: pkg.dependencies,
209-
devDependencies: pkg.devDependencies,
208+
dependencies: appPackageJson.dependencies,
209+
devDependencies: appPackageJson.devDependencies,
210+
// VS Code extensions and the plugins folder is defined in the top level `package.json`. The template picks them up.
211+
theiaPluginsDir: rootPackageJson.theiaPluginsDir,
212+
theiaPlugins: rootPackageJson.theiaPlugins,
210213
};
211-
const overwriteMerge = (destinationArray, sourceArray, options) =>
212-
sourceArray;
213214
fs.writeFileSync(
214215
path('..', 'build', 'package.json'),
215216
JSON.stringify(
216-
merge(content, template, { arrayMerge: overwriteMerge }),
217+
merge(content, template, { arrayMerge: (_, sourceArray) => sourceArray }),
217218
null,
218219
2
219220
)

‎i18n/en.json

+26-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"board": "Board{0}",
99
"boardConfigDialogTitle": "Select Other Board and Port",
1010
"boardInfo": "Board Info",
11+
"boards": "boards",
1112
"configDialog1": "Select both a Board and a Port if you want to upload a sketch.",
1213
"configDialog2": "If you only select a Board you will be able to compile, but not to upload your sketch.",
1314
"couldNotFindPreviouslySelected": "Could not find previously selected board '{0}' in installed platform '{1}'. Please manually reselect the board you want to use. Do you want to reselect it now?",
@@ -25,15 +26,18 @@
2526
"pleasePickBoard": "Please pick a board connected to the port you have selected.",
2627
"port": "Port{0}",
2728
"portLabel": "Port: {0}",
29+
"ports": "ports",
2830
"programmer": "Programmer",
2931
"reselectLater": "Reselect later",
3032
"searchBoard": "Search board",
3133
"selectBoard": "Select Board",
3234
"selectBoardForInfo": "Please select a board to obtain board info.",
3335
"selectPortForInfo": "Please select a port to obtain board info.",
3436
"showAllAvailablePorts": "Shows all available ports when enabled",
37+
"showAllPorts": "Show all ports",
3538
"succesfullyInstalledPlatform": "Successfully installed platform {0}:{1}",
36-
"succesfullyUninstalledPlatform": "Successfully uninstalled platform {0}:{1}"
39+
"succesfullyUninstalledPlatform": "Successfully uninstalled platform {0}:{1}",
40+
"typeOfPorts": "{0} ports"
3741
},
3842
"boardsManager": "Boards Manager",
3943
"boardsType": {
@@ -149,8 +153,19 @@
149153
"contributions": {
150154
"addFile": "Add File",
151155
"fileAdded": "One file added to the sketch.",
156+
"plotter": {
157+
"couldNotOpen": "Couldn't open serial plotter"
158+
},
152159
"replaceTitle": "Replace"
153160
},
161+
"core": {
162+
"compilerWarnings": {
163+
"all": "All",
164+
"default": "Default",
165+
"more": "More",
166+
"none": "None"
167+
}
168+
},
154169
"coreContribution": {
155170
"copyError": "Copy error messages",
156171
"noBoardSelected": "No board selected. Please select your Arduino board from the Tools > Board menu."
@@ -282,6 +297,10 @@
282297
"unableToCloseWebSocket": "Unable to close websocket",
283298
"unableToConnectToWebSocket": "Unable to connect to websocket"
284299
},
300+
"portProtocol": {
301+
"network": "Network",
302+
"serial": "Serial"
303+
},
285304
"preferences": {
286305
"additionalManagerURLs": "Additional Boards Manager URLs",
287306
"auth.audience": "The OAuth2 audience.",
@@ -321,6 +340,12 @@
321340
"network": "Network",
322341
"newSketchbookLocation": "Select new sketchbook location",
323342
"noProxy": "No proxy",
343+
"proxySettings": {
344+
"hostname": "Host name",
345+
"password": "Password",
346+
"port": "Port number",
347+
"username": "Username"
348+
},
324349
"showVerbose": "Show verbose output during",
325350
"sketchbook.location": "Sketchbook location",
326351
"sketchbook.showAllFiles": "True to show all sketch files inside the sketch. It is false by default.",

‎package.json

+15-10
Original file line numberDiff line numberDiff line change
@@ -78,16 +78,21 @@
7878
"vscode-builtin-json": "https://open-vsx.org/api/vscode/json/1.46.1/file/vscode.json-1.46.1.vsix",
7979
"vscode-builtin-json-language-features": "https://open-vsx.org/api/vscode/json-language-features/1.46.1/file/vscode.json-language-features-1.46.1.vsix",
8080
"cortex-debug": "https://open-vsx.org/api/marus25/cortex-debug/0.3.10/file/marus25.cortex-debug-0.3.10.vsix",
81+
"vscode-language-pack-bg": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-bg/1.48.3/file/MS-CEINTL.vscode-language-pack-bg-1.48.3.vsix",
82+
"vscode-language-pack-cs": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-cs/1.53.2/file/MS-CEINTL.vscode-language-pack-cs-1.53.2.vsix",
83+
"vscode-language-pack-de": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-de/1.53.2/file/MS-CEINTL.vscode-language-pack-de-1.53.2.vsix",
84+
"vscode-language-pack-es": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-es/1.53.2/file/MS-CEINTL.vscode-language-pack-es-1.53.2.vsix",
85+
"vscode-language-pack-fr": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-fr/1.53.2/file/MS-CEINTL.vscode-language-pack-fr-1.53.2.vsix",
86+
"vscode-language-pack-hu": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-hu/1.48.3/file/MS-CEINTL.vscode-language-pack-hu-1.48.3.vsix",
87+
"vscode-language-pack-it": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-it/1.53.2/file/MS-CEINTL.vscode-language-pack-it-1.53.2.vsix",
88+
"vscode-language-pack-ja": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-ja/1.53.2/file/MS-CEINTL.vscode-language-pack-ja-1.53.2.vsix",
89+
"vscode-language-pack-ko": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-ko/1.53.2/file/MS-CEINTL.vscode-language-pack-ko-1.53.2.vsix",
8190
"vscode-language-pack-nl": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-nl/1.48.3/file/MS-CEINTL.vscode-language-pack-nl-1.48.3.vsix",
82-
"vscode-language-pack-fr": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-fr/1.69.0/file/MS-CEINTL.vscode-language-pack-fr-1.69.0.vsix",
83-
"vscode-language-pack-zh-hans": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-zh-hans/1.69.0/file/MS-CEINTL.vscode-language-pack-zh-hans-1.69.0.vsix",
84-
"vscode-language-pack-de": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-de/1.69.0/file/MS-CEINTL.vscode-language-pack-de-1.69.0.vsix",
85-
"vscode-language-pack-ja": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-ja/1.69.0/file/MS-CEINTL.vscode-language-pack-ja-1.69.0.vsix",
86-
"vscode-language-pack-tr": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-tr/1.69.0/file/MS-CEINTL.vscode-language-pack-tr-1.69.0.vsix",
87-
"vscode-language-pack-it": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-it/1.69.0/file/MS-CEINTL.vscode-language-pack-it-1.69.0.vsix",
88-
"vscode-language-pack-ru": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-ru/1.69.0/file/MS-CEINTL.vscode-language-pack-ru-1.69.0.vsix",
89-
"vscode-language-pack-es": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-es/1.69.0/file/MS-CEINTL.vscode-language-pack-es-1.69.0.vsix",
90-
"vscode-language-pack-pt-BR": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-pt-BR/1.69.0/file/MS-CEINTL.vscode-language-pack-pt-BR-1.69.0.vsix",
91-
"vscode-language-pack-cs": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-cs/1.69.0/file/MS-CEINTL.vscode-language-pack-cs-1.69.0.vsix"
91+
"vscode-language-pack-pl": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-pl/1.53.2/file/MS-CEINTL.vscode-language-pack-pl-1.53.2.vsix",
92+
"vscode-language-pack-pt-BR": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-pt-BR/1.53.2/file/MS-CEINTL.vscode-language-pack-pt-BR-1.53.2.vsix",
93+
"vscode-language-pack-ru": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-ru/1.53.2/file/MS-CEINTL.vscode-language-pack-ru-1.53.2.vsix",
94+
"vscode-language-pack-tr": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-tr/1.53.2/file/MS-CEINTL.vscode-language-pack-tr-1.53.2.vsix",
95+
"vscode-language-pack-uk": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-uk/1.48.3/file/MS-CEINTL.vscode-language-pack-uk-1.48.3.vsix",
96+
"vscode-language-pack-zh-hans": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-zh-hans/1.53.2/file/MS-CEINTL.vscode-language-pack-zh-hans-1.53.2.vsix"
9297
}
9398
}

0 commit comments

Comments
 (0)
Please sign in to comment.