mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-06-21 11:36:32 +00:00
set the current language on the localization provider (#957)
This commit is contained in:
parent
a3640cf812
commit
a44b84ffd0
arduino-ide-extension/src
@ -278,9 +278,9 @@ export class SettingsService {
|
|||||||
// after saving all the settings, if we need to change the language we need to perform a reload
|
// after saving all the settings, if we need to change the language we need to perform a reload
|
||||||
// Only reload if the language differs from the current locale. `nls.locale === undefined` signals english as well
|
// Only reload if the language differs from the current locale. `nls.locale === undefined` signals english as well
|
||||||
if (
|
if (
|
||||||
currentLanguage !== nls.locale &&
|
currentLanguage !== (await this.localizationProvider.getCurrentLanguage())
|
||||||
!(currentLanguage === 'en' && nls.locale === undefined)
|
|
||||||
) {
|
) {
|
||||||
|
await this.localizationProvider.setCurrentLanguage(currentLanguage);
|
||||||
if (currentLanguage === 'en') {
|
if (currentLanguage === 'en') {
|
||||||
window.localStorage.removeItem(nls.localeId);
|
window.localStorage.removeItem(nls.localeId);
|
||||||
} else {
|
} else {
|
||||||
|
@ -12,7 +12,6 @@ import { Event, Emitter } from '@theia/core/lib/common/event';
|
|||||||
import { environment } from '@theia/application-package/lib/environment';
|
import { environment } from '@theia/application-package/lib/environment';
|
||||||
import { EnvVariablesServer } from '@theia/core/lib/common/env-variables';
|
import { EnvVariablesServer } from '@theia/core/lib/common/env-variables';
|
||||||
import { BackendApplicationContribution } from '@theia/core/lib/node/backend-application';
|
import { BackendApplicationContribution } from '@theia/core/lib/node/backend-application';
|
||||||
import { LocalizationProvider } from '@theia/core/lib/node/i18n/localization-provider';
|
|
||||||
import { ArduinoDaemon, NotificationServiceServer } from '../common/protocol';
|
import { ArduinoDaemon, NotificationServiceServer } from '../common/protocol';
|
||||||
import { DaemonLog } from './daemon-log';
|
import { DaemonLog } from './daemon-log';
|
||||||
import { CLI_CONFIG } from './cli-config';
|
import { CLI_CONFIG } from './cli-config';
|
||||||
@ -32,9 +31,6 @@ export class ArduinoDaemonImpl
|
|||||||
@inject(NotificationServiceServer)
|
@inject(NotificationServiceServer)
|
||||||
protected readonly notificationService: NotificationServiceServer;
|
protected readonly notificationService: NotificationServiceServer;
|
||||||
|
|
||||||
@inject(LocalizationProvider)
|
|
||||||
protected readonly localizationProvider: LocalizationProvider;
|
|
||||||
|
|
||||||
protected readonly toDispose = new DisposableCollection();
|
protected readonly toDispose = new DisposableCollection();
|
||||||
protected readonly onDaemonStartedEmitter = new Emitter<void>();
|
protected readonly onDaemonStartedEmitter = new Emitter<void>();
|
||||||
protected readonly onDaemonStoppedEmitter = new Emitter<void>();
|
protected readonly onDaemonStoppedEmitter = new Emitter<void>();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user