mirror of
https://github.com/directus/directus.git
synced 2026-04-25 03:00:53 -04:00
Fix field translations for system tables
This commit is contained in:
@@ -791,8 +791,23 @@
|
||||
"locale": "Locale",
|
||||
"avatar": "Avatar",
|
||||
"theme": "Theme",
|
||||
"2fa_secret": "Two-Factor Authentication"
|
||||
}
|
||||
"tfa_secret": "Two-Factor Authentication"
|
||||
},
|
||||
"directus_settings": {
|
||||
"project_name": "Project Name",
|
||||
"project_url": "Project URL",
|
||||
"project_color": "Project Color",
|
||||
"project_logo": "Project Logo",
|
||||
"public_foreground": "Public Foreground",
|
||||
"public_background": "Public Background",
|
||||
"public_note": "Public Note",
|
||||
"auth_password_policy": "Auth Password Policy",
|
||||
"auth_idle_timeout": "Auth Idle Timeout",
|
||||
"auth_login_attempts": "Auth Login Attempts",
|
||||
"storage_asset_presets": "Storage Asset Presets",
|
||||
"storage_asset_transform": "Storage Asset Transform",
|
||||
"telemetry": "Telemetry"
|
||||
}
|
||||
},
|
||||
|
||||
"modules": {},
|
||||
|
||||
@@ -90,18 +90,22 @@ export const useFieldsStore = createStore({
|
||||
|
||||
const system = field.system === null ? getSystemDefault(field.collection, field.field) : field.system;
|
||||
|
||||
if (notEmpty(system.translation) && system.translation.length > 0) {
|
||||
if (i18n.te(`fields.${field.collection}.${field.field}`)) {
|
||||
name = i18n.t(`fields.${field.collection}.${field.field}`);
|
||||
} else if (notEmpty(system.translation) && system.translation.length > 0) {
|
||||
for (let i = 0; i < system.translation.length; i++) {
|
||||
const { locale, translation } = system.translation[i];
|
||||
|
||||
i18n.mergeLocaleMessage(locale, {
|
||||
fields: {
|
||||
[field.field]: translation,
|
||||
[field.collection]: {
|
||||
[field.field]: translation
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
name = i18n.t(`fields.${field.field}`);
|
||||
name = i18n.t(`fields.${field.collection}.${field.field}`);
|
||||
} else {
|
||||
name = formatTitle(field.field);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user