fix: missing i18n parameter in simulater and renderer

This commit is contained in:
huxingyi1997 2023-03-17 12:04:37 +08:00 committed by 刘菊萍(絮黎)
parent 6d4ca29466
commit fc7c217f8c
2 changed files with 4 additions and 2 deletions

View File

@ -6,6 +6,7 @@ import {
getPublicPath, getPublicPath,
focusTracker, focusTracker,
engineConfig, engineConfig,
globalLocale,
IReactionPublic, IReactionPublic,
IReactionOptions, IReactionOptions,
IReactionDisposer, IReactionDisposer,
@ -198,7 +199,7 @@ export class BuiltinSimulatorHost implements ISimulatorHost<BuiltinSimulatorProp
} }
@computed get locale(): string { @computed get locale(): string {
return this.get('locale'); return this.get('locale') || globalLocale.getLocale();
} }
@computed get deviceClassName(): string | undefined { @computed get deviceClassName(): string | undefined {

View File

@ -461,6 +461,7 @@ export class SimulatorRendererContainer implements BuiltinSimulatorRenderer {
locale: renderer.locale, locale: renderer.locale,
messages: _schema.i18n || {}, messages: _schema.i18n || {},
device: renderer.device, device: renderer.device,
locale: renderer.locale,
appHelper: renderer.context, appHelper: renderer.context,
rendererName: 'LowCodeRenderer', rendererName: 'LowCodeRenderer',
thisRequiredInJSE: host.thisRequiredInJSE, thisRequiredInJSE: host.thisRequiredInJSE,
@ -632,4 +633,4 @@ function getLowCodeComponentProps(props: any) {
return newProps; return newProps;
} }
export default new SimulatorRendererContainer(); export default new SimulatorRendererContainer();