Skip to content

Build your own AI office with Univer Office SDK. Bring editing, calculation, collaboration, and file processing into your product for people and AI agents. Built on an extensible open-source core.

fix(locale): fix default language isn't loaded (#202)

白熱4c16dac94593
diff --git a/packages/ui-plugin-docs/src/doc-ui-plugin.ts b/packages/ui-plugin-docs/src/doc-ui-plugin.ts
index 2766b5c8e5..475db1ac27 100644
--- a/packages/ui-plugin-docs/src/doc-ui-plugin.ts
+++ b/packages/ui-plugin-docs/src/doc-ui-plugin.ts
@@ -5,6 +5,7 @@ import { DefaultDocUiConfig, IDocUIPluginConfig, installObserver } from './Basic
import { DOC_UI_PLUGIN_NAME } from './Basics/Const/PLUGIN_NAME';
import { AppUIController } from './Controller';
import { DocClipboardController } from './Controller/clipboard.controller';
+import { en } from './Locale';
import { DocClipboardService, IDocClipboardService } from './services/clipboard/clipboard.service';
export class DocUIPlugin extends Plugin<any> {
@@ -13,10 +14,14 @@ export class DocUIPlugin extends Plugin<any> {
constructor(
private readonly _config: IDocUIPluginConfig,
@Inject(Injector) override _injector: Injector,
- @Inject(LocaleService) private readonly _localService: LocaleService
+ @Inject(LocaleService) private readonly _localeService: LocaleService
) {
super(DOC_UI_PLUGIN_NAME);
+ this._localeService.getLocale().load({
+ en,
+ });
+
this._config = Tools.deepMerge({}, DefaultDocUiConfig, this._config);
this._initDependencies(_injector);
}
diff --git a/packages/ui-plugin-sheets/src/sheet-ui-plugin.ts b/packages/ui-plugin-sheets/src/sheet-ui-plugin.ts
index 80c8ca81ce..959f385844 100644
--- a/packages/ui-plugin-sheets/src/sheet-ui-plugin.ts
+++ b/packages/ui-plugin-sheets/src/sheet-ui-plugin.ts
@@ -5,6 +5,7 @@ import { Dependency, Inject, Injector } from '@wendellhu/redi';
import { SHEET_UI_PLUGIN_NAME } from './Basics';
import { SheetClipboardController } from './controller/clipboard/clipboard.controller';
import { SheetUIController } from './controller/sheet-ui.controller';
+import { en } from './Locale';
import { ICellEditorService } from './services/cell-editor/cell-editor.service';
import { DesktopCellEditorService } from './services/cell-editor/cell-editor-desktop.service';
import { ISheetClipboardService, SheetClipboardService } from './services/clipboard/clipboard.service';
@@ -17,6 +18,10 @@ export class SheetUIPlugin extends Plugin {
@Inject(LocaleService) private readonly _localeService: LocaleService
) {
super(SHEET_UI_PLUGIN_NAME);
+
+ this._localeService.getLocale().load({
+ en,
+ });
}
override onStarting(injector: Injector): void {