fix: locale resource name

This commit is contained in:
chenos 2023-12-22 18:49:58 +08:00
parent 3b5240cc0a
commit 2e038a651b

View File

@ -79,7 +79,7 @@ export class Locale {
if (!p) { if (!p) {
continue; continue;
} }
const packageName = p.options?.packageName; const packageName: string = p.options?.packageName;
if (!packageName) { if (!packageName) {
continue; continue;
} }
@ -88,8 +88,8 @@ export class Locale {
const res = getResource(packageName, lang); const res = getResource(packageName, lang);
if (res) { if (res) {
resources[packageName] = { ...res }; resources[packageName] = { ...res };
if (name !== packageName) { if (packageName.includes('@nocobase/plugin-')) {
resources[name] = { ...res }; resources[packageName.substring('@nocobase/plugin-'.length)] = { ...res };
} }
} }
} catch (err) { } catch (err) {