From a6c23d58a1b55373e9bb4302ae83ba1720de3f02 Mon Sep 17 00:00:00 2001 From: YANG QIA <2013xile@gmail.com> Date: Tue, 19 Dec 2023 13:51:26 +0800 Subject: [PATCH] fix(localization): compatibility with plugin package names as namespaces (#3234) --- packages/core/server/src/locale/locale.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/core/server/src/locale/locale.ts b/packages/core/server/src/locale/locale.ts index e05d24b38..77959d1bc 100644 --- a/packages/core/server/src/locale/locale.ts +++ b/packages/core/server/src/locale/locale.ts @@ -87,7 +87,10 @@ export class Locale { // this.app.setMaintainingMessage(`load [${packageName}] locale resource `); const res = getResource(packageName, lang); if (res) { - resources[name] = { ...res }; + resources[packageName] = { ...res }; + if (name !== packageName) { + resources[name] = { ...res }; + } } } catch (err) { // empty