mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-06-16 17:16:34 +00:00
set the current language on the localization provider (#957)
This commit is contained in:
parent
a3640cf812
commit
a44b84ffd0
@ -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 {
|
||||
|
@ -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>();
|
||||
|
Loading…
x
Reference in New Issue
Block a user