Skip to content

Enable language packs #941

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion arduino-ide-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@
"description": "An extension for Theia building the Arduino IDE",
"license": "AGPL-3.0-or-later",
"scripts": {
"prepare": "yarn download-cli && yarn download-fwuploader && yarn download-ls && yarn copy-serial-plotter && yarn clean && yarn download-examples && yarn build && yarn test",
"prepare": "yarn download-cli && yarn download-fwuploader && yarn download-ls && yarn copy-serial-plotter && yarn copy-i18n && yarn clean && yarn download-examples && yarn build && yarn test",
"clean": "rimraf lib",
"compose-changelog": "node ./scripts/compose-changelog.js",
"download-cli": "node ./scripts/download-cli.js",
"download-fwuploader": "node ./scripts/download-fwuploader.js",
"copy-serial-plotter": "npx ncp ../node_modules/arduino-serial-plotter-webapp ./build/arduino-serial-plotter-webapp",
"copy-i18n": "npx ncp ../i18n ./build/i18n",
"download-ls": "node ./scripts/download-ls.js",
"download-examples": "node ./scripts/download-examples.js",
"generate-protocol": "node ./scripts/generate-protocol.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,6 @@ export class AddZipLibrary extends SketchContribution {
...ArduinoMenus.SKETCH__UTILS_GROUP,
'0_include',
];
// TODO: do we need it? calling `registerSubmenu` multiple times is noop, so it does not hurt.
registry.registerSubmenu(includeLibMenuPath, 'Include Library', {
order: '1',
});
registry.registerMenuAction([...includeLibMenuPath, '1_install'], {
commandId: AddZipLibrary.Commands.ADD_ZIP_LIBRARY.id,
label: nls.localize('arduino/library/addZip', 'Add .ZIP Library...'),
Expand Down
4 changes: 4 additions & 0 deletions arduino-ide-extension/src/node/arduino-ide-backend-module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ import { ArduinoFirmwareUploaderImpl } from './arduino-firmware-uploader-impl';
import { PlotterBackendContribution } from './plotter/plotter-backend-contribution';
import WebSocketServiceImpl from './web-socket/web-socket-service-impl';
import { WebSocketService } from './web-socket/web-socket-service';
import { ArduinoLocalizationContribution } from './arduino-localization-contribution';
import { LocalizationContribution } from '@theia/core/lib/node/i18n/localization-contribution';

export default new ContainerModule((bind, unbind, isBound, rebind) => {
bind(BackendApplication).toSelf().inSingletonScope();
Expand Down Expand Up @@ -340,4 +342,6 @@ export default new ContainerModule((bind, unbind, isBound, rebind) => {

bind(PlotterBackendContribution).toSelf().inSingletonScope();
bind(BackendApplicationContribution).toService(PlotterBackendContribution);
bind(ArduinoLocalizationContribution).toSelf().inSingletonScope();
bind(LocalizationContribution).toService(ArduinoLocalizationContribution);
});
152 changes: 152 additions & 0 deletions arduino-ide-extension/src/node/arduino-localization-contribution.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
import {
LocalizationContribution,
LocalizationRegistry,
} from '@theia/core/lib/node/i18n/localization-contribution';
import { injectable } from 'inversify';

@injectable()
export class ArduinoLocalizationContribution
implements LocalizationContribution
{
async registerLocalizations(registry: LocalizationRegistry): Promise<void> {
registry.registerLocalizationFromRequire(
'af',
require('../../build/i18n/af.json')
);

registry.registerLocalizationFromRequire(
'en',
require('../../build/i18n/en.json')
);

registry.registerLocalizationFromRequire(
'fr',
require('../../build/i18n/fr.json')
);

registry.registerLocalizationFromRequire(
'ko',
require('../../build/i18n/ko.json')
);

registry.registerLocalizationFromRequire(
'pt',
require('../../build/i18n/pt.json')
);

registry.registerLocalizationFromRequire(
'uk_UA',
require('../../build/i18n/uk_UA.json')
);

registry.registerLocalizationFromRequire(
'ar',
require('../../build/i18n/ar.json')
);

registry.registerLocalizationFromRequire(
'es',
require('../../build/i18n/es.json')
);

registry.registerLocalizationFromRequire(
'he',
require('../../build/i18n/he.json')
);

registry.registerLocalizationFromRequire(
'my_MM',
require('../../build/i18n/my_MM.json')
);

registry.registerLocalizationFromRequire(
'ro',
require('../../build/i18n/ro.json')
);

registry.registerLocalizationFromRequire(
'zh-cn',
require('../../build/i18n/zh.json')
);

registry.registerLocalizationFromRequire(
'bg',
require('../../build/i18n/bg.json')
);

registry.registerLocalizationFromRequire(
'eu',
require('../../build/i18n/eu.json')
);

registry.registerLocalizationFromRequire(
'hu',
require('../../build/i18n/hu.json')
);

registry.registerLocalizationFromRequire(
'ne',
require('../../build/i18n/ne.json')
);

registry.registerLocalizationFromRequire(
'ru',
require('../../build/i18n/ru.json')
);

registry.registerLocalizationFromRequire(
'zh_TW',
require('../../build/i18n/zh_TW.json')
);

registry.registerLocalizationFromRequire(
'de',
require('../../build/i18n/de.json')
);

registry.registerLocalizationFromRequire(
'fa',
require('../../build/i18n/fa.json')
);

registry.registerLocalizationFromRequire(
'it',
require('../../build/i18n/it.json')
);

registry.registerLocalizationFromRequire(
'nl',
require('../../build/i18n/nl.json')
);

registry.registerLocalizationFromRequire(
'sv_SE',
require('../../build/i18n/sv_SE.json')
);

registry.registerLocalizationFromRequire(
'el',
require('../../build/i18n/el.json')
);

registry.registerLocalizationFromRequire(
'fil',
require('../../build/i18n/fil.json')
);

registry.registerLocalizationFromRequire(
'ja',
require('../../build/i18n/ja.json')
);

registry.registerLocalizationFromRequire(
'pl',
require('../../build/i18n/pl.json')
);

registry.registerLocalizationFromRequire(
'tr',
require('../../build/i18n/tr.json')
);
}
}
8 changes: 7 additions & 1 deletion electron/build/template-package.json
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,12 @@
"vscode-arduino-tools": "https://downloads.arduino.cc/vscode-arduino-tools/vscode-arduino-tools-0.0.2-beta.2.vsix",
"vscode-builtin-json": "https://open-vsx.org/api/vscode/json/1.46.1/file/vscode.json-1.46.1.vsix",
"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",
"cortex-debug": "https://open-vsx.org/api/marus25/cortex-debug/0.3.10/file/marus25.cortex-debug-0.3.10.vsix"
"cortex-debug": "https://open-vsx.org/api/marus25/cortex-debug/0.3.10/file/marus25.cortex-debug-0.3.10.vsix",
"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",
"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",
"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",
"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",
"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",
"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"
}
}
1 change: 1 addition & 0 deletions electron/packager/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
'yarn.lock',
'package.json',
'lerna.json',
'i18n'
]) {
cp('-rf', path(rootPath, name), path('..', workingCopy));
}
Expand Down
8 changes: 7 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@
"vscode-arduino-tools": "https://downloads.arduino.cc/vscode-arduino-tools/vscode-arduino-tools-0.0.2-beta.2.vsix",
"vscode-builtin-json": "https://open-vsx.org/api/vscode/json/1.46.1/file/vscode.json-1.46.1.vsix",
"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",
"cortex-debug": "https://open-vsx.org/api/marus25/cortex-debug/0.3.10/file/marus25.cortex-debug-0.3.10.vsix"
"cortex-debug": "https://open-vsx.org/api/marus25/cortex-debug/0.3.10/file/marus25.cortex-debug-0.3.10.vsix",
"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",
"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",
"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",
"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",
"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",
"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"
}
}