set the current language on the localization provider (#957)

This commit is contained in:
Alberto Iannaccone 2022-04-15 15:54:37 +02:00 committed by GitHub
parent a3640cf812
commit a44b84ffd0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 6 deletions

View File

@ -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
// Only reload if the language differs from the current locale. `nls.locale === undefined` signals english as well
if (
currentLanguage !== nls.locale &&
!(currentLanguage === 'en' && nls.locale === undefined)
currentLanguage !== (await this.localizationProvider.getCurrentLanguage())
) {
await this.localizationProvider.setCurrentLanguage(currentLanguage);
if (currentLanguage === 'en') {
window.localStorage.removeItem(nls.localeId);
} else {

View File

@ -12,7 +12,6 @@ import { Event, Emitter } from '@theia/core/lib/common/event';
import { environment } from '@theia/application-package/lib/environment';
import { EnvVariablesServer } from '@theia/core/lib/common/env-variables';
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 { DaemonLog } from './daemon-log';
import { CLI_CONFIG } from './cli-config';
@ -32,9 +31,6 @@ export class ArduinoDaemonImpl
@inject(NotificationServiceServer)
protected readonly notificationService: NotificationServiceServer;
@inject(LocalizationProvider)
protected readonly localizationProvider: LocalizationProvider;
protected readonly toDispose = new DisposableCollection();
protected readonly onDaemonStartedEmitter = new Emitter<void>();
protected readonly onDaemonStoppedEmitter = new Emitter<void>();