From cb44f473182a3cd125606becc8f8cf7a8407f525 Mon Sep 17 00:00:00 2001 From: per1234 Date: Sat, 20 Aug 2022 20:24:11 -0700 Subject: [PATCH 1/2] Add missing i18n for UI strings The text of the Arduino IDE user interface has been localized to 12 languages. Before localization can be accomplished, internationalization must be done in the application's code base: - Set up infrastructure to export localization data - Pass all target strings to that infrastructure While the first of these tasks is completed, the second was not completed for several strings which are part of the user interface. Those outstanding strings are hereby internationalized and will be made available for localization. --- .../src/browser/boards/boards-config.tsx | 9 +++++++-- .../dialogs/user-fields/user-fields-component.tsx | 6 +++++- arduino-ide-extension/src/node/boards-service-impl.ts | 6 +++++- i18n/en.json | 4 ++++ 4 files changed, 21 insertions(+), 4 deletions(-) diff --git a/arduino-ide-extension/src/browser/boards/boards-config.tsx b/arduino-ide-extension/src/browser/boards/boards-config.tsx index c72ba7641..3e55b2b0d 100644 --- a/arduino-ide-extension/src/browser/boards/boards-config.tsx +++ b/arduino-ide-extension/src/browser/boards/boards-config.tsx @@ -306,7 +306,10 @@ export class BoardsConfig extends React.Component< type="search" value={query} className="theia-input" - placeholder="SEARCH BOARD" + placeholder={nls.localize( + 'arduino/board/searchBoard', + 'SEARCH BOARD' + )} onChange={this.updateBoards} ref={this.focusNodeSet} /> @@ -344,7 +347,9 @@ export class BoardsConfig extends React.Component< }); } return !ports.length ? ( -
No ports discovered
+
+ {nls.localize('arduino/board/noPortsDiscovered', 'No ports discovered')} +
) : (
{ports.map((port) => ( diff --git a/arduino-ide-extension/src/browser/dialogs/user-fields/user-fields-component.tsx b/arduino-ide-extension/src/browser/dialogs/user-fields/user-fields-component.tsx index 8676dc749..ae8797fca 100644 --- a/arduino-ide-extension/src/browser/dialogs/user-fields/user-fields-component.tsx +++ b/arduino-ide-extension/src/browser/dialogs/user-fields/user-fields-component.tsx @@ -65,7 +65,11 @@ export const UserFieldsComponent = ({ type={field.secret ? 'password' : 'text'} value={field.value} className="theia-input" - placeholder={'Enter ' + field.label} + placeholder={nls.localize( + 'arduino/userFields/enterField', + 'Enter {0}', + field.label + )} onChange={updateUserField(index)} />
diff --git a/arduino-ide-extension/src/node/boards-service-impl.ts b/arduino-ide-extension/src/node/boards-service-impl.ts index e4f1fad3b..ccad3147d 100644 --- a/arduino-ide-extension/src/node/boards-service-impl.ts +++ b/arduino-ide-extension/src/node/boards-service-impl.ts @@ -42,6 +42,7 @@ import { } from './cli-protocol/cc/arduino/cli/commands/v1/upload_pb'; import { ExecuteWithProgress } from './grpc-progressible'; import { ServiceError } from './service-error'; +import { nls } from '@theia/core/lib/common'; @injectable() export class BoardsServiceImpl @@ -319,7 +320,10 @@ export class BoardsServiceImpl .join(', '), installable: true, deprecated: platform.getDeprecated(), - summary: 'Boards included in this package:', + summary: nls.localize( + 'arduino/component/boardsIncluded', + 'Boards included in this package:' + ), installedVersion, boards: platform .getBoardsList() diff --git a/i18n/en.json b/i18n/en.json index 31a378636..3bf13c5ff 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -17,6 +17,7 @@ "installManually": "Install Manually", "installNow": "The \"{0} {1}\" core has to be installed for the currently selected \"{2}\" board. Do you want to install it now?", "noFQBN": "The FQBN is not available for the selected board \"{0}\". Do you have the corresponding core installed?", + "noPortsDiscovered": "No ports discovered", "noPortsSelected": "No ports selected for board: '{0}'.", "noneSelected": "No boards selected.", "openBoardsConfig": "Select other board and port…", @@ -26,6 +27,7 @@ "portLabel": "Port: {0}", "programmer": "Programmer", "reselectLater": "Reselect later", + "searchBoard": "SEARCH BOARD", "selectBoard": "Select Board", "selectBoardForInfo": "Please select a board to obtain board info.", "selectPortForInfo": "Please select a port to obtain board info.", @@ -115,6 +117,7 @@ "error": "Compilation error: {0}" }, "component": { + "boardsIncluded": "Boards included in this package:", "by": "by", "filterSearch": "Filter your search...", "install": "INSTALL", @@ -344,6 +347,7 @@ }, "userFields": { "cancel": "Cancel", + "enterField": "Enter {0}", "upload": "Upload" } }, From d250a1725e2eb9a23966cc32515dd3f09e7b4920 Mon Sep 17 00:00:00 2001 From: per1234 Date: Sun, 21 Aug 2022 17:59:26 -0700 Subject: [PATCH 2/2] Fix inconsistency of input field placeholder text capitalization The board search input field of the "Select Other Board and Port" dialog uses placeholder text to explain the usage of the field to the user. All other placeholder text in the IDE's UI uses sentence case. This specific placeholder was the exception, using unpleasant caps lock instead. The inconsistency is resolved by changing the placeholder text to the standard sentence case. --- arduino-ide-extension/src/browser/boards/boards-config.tsx | 2 +- i18n/en.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arduino-ide-extension/src/browser/boards/boards-config.tsx b/arduino-ide-extension/src/browser/boards/boards-config.tsx index 3e55b2b0d..ce5d9eda1 100644 --- a/arduino-ide-extension/src/browser/boards/boards-config.tsx +++ b/arduino-ide-extension/src/browser/boards/boards-config.tsx @@ -308,7 +308,7 @@ export class BoardsConfig extends React.Component< className="theia-input" placeholder={nls.localize( 'arduino/board/searchBoard', - 'SEARCH BOARD' + 'Search board' )} onChange={this.updateBoards} ref={this.focusNodeSet} diff --git a/i18n/en.json b/i18n/en.json index 3bf13c5ff..1b8a65f74 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -27,7 +27,7 @@ "portLabel": "Port: {0}", "programmer": "Programmer", "reselectLater": "Reselect later", - "searchBoard": "SEARCH BOARD", + "searchBoard": "Search board", "selectBoard": "Select Board", "selectBoardForInfo": "Please select a board to obtain board info.", "selectPortForInfo": "Please select a port to obtain board info.",