Skip to content

Commit 8eddd1f

Browse files
author
Akos Kitta
committed
translate compiler warnings.
Signed-off-by: Akos Kitta <[email protected]>
1 parent cb48b33 commit 8eddd1f

File tree

3 files changed

+22
-1
lines changed

3 files changed

+22
-1
lines changed

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

+2-1
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>

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;

Diff for: i18n/en.json

+8
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,14 @@
157157
},
158158
"replaceTitle": "Replace"
159159
},
160+
"core": {
161+
"compilerWarnings": {
162+
"all": "All",
163+
"default": "Default",
164+
"more": "More",
165+
"none": "None"
166+
}
167+
},
160168
"coreContribution": {
161169
"copyError": "Copy error messages",
162170
"noBoardSelected": "No board selected. Please select your Arduino board from the Tools > Board menu."

0 commit comments

Comments
 (0)