mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-11-12 03:39:27 +00:00
- Updated `@theia/*` to `1.37.0`. - Fixed all `yarn audit` security vulnerabilities. - Updated to `electron@23.2.4`: - `contextIsolation` is `true`, - `nodeIntegration` is `false`, and the - `webpack` target is moved from `electron-renderer` to `web`. - Updated to `typescript@4.9.3`. - Updated the `eslint` plugins. - Added the new `Light High Contrast` theme to the IDE2. - High contrast themes use Theia APIs for style adjustments. - Support for ESM modules: `"moduleResolution": "node16"`. - Node.js >= 16.14 is required. - VISX langage packs were bumped to `1.70.0`. - Removed undesired editor context menu items. (Closes #1394) Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
48 lines
1.4 KiB
TypeScript
48 lines
1.4 KiB
TypeScript
import {
|
|
LocalizationContribution,
|
|
LocalizationRegistry,
|
|
} from '@theia/core/lib/node/i18n/localization-contribution';
|
|
import { injectable } from '@theia/core/shared/inversify';
|
|
import { join } from 'node:path';
|
|
|
|
@injectable()
|
|
export class ArduinoLocalizationContribution
|
|
implements LocalizationContribution
|
|
{
|
|
// 0. index: locale
|
|
// 1. index: optional JSON file to `require` (if differs from the locale)
|
|
// If you touch the locales, please keep the alphabetical order. Also in the `package.json` for the VS Code language packs. Thank you! ❤️
|
|
// Note that IDE2 has more translations than available VS Code language packs. (https://github.com/arduino/arduino-ide/issues/1447)
|
|
private readonly locales: ReadonlyArray<[string, string?]> = [
|
|
['bg'],
|
|
['cs'],
|
|
['de'],
|
|
['es'],
|
|
['fr'],
|
|
['hu'],
|
|
// ['id'], Does not have Transifex translations, but has a VS Code language pack available on Open VSX.
|
|
['it'],
|
|
['ja'],
|
|
['ko'],
|
|
['nl'],
|
|
['pl'],
|
|
['pt-br', 'pt'],
|
|
['ru'],
|
|
['tr'],
|
|
['uk', 'uk_UA'],
|
|
['zh-cn', 'zh'],
|
|
];
|
|
|
|
async registerLocalizations(registry: LocalizationRegistry): Promise<void> {
|
|
for (const [locale, jsonFilename] of this.locales) {
|
|
registry.registerLocalizationFromRequire(
|
|
locale,
|
|
require(join(
|
|
__dirname,
|
|
`../../../build/i18n/${jsonFilename ?? locale}.json`
|
|
))
|
|
);
|
|
}
|
|
}
|
|
}
|