feat(i18n): display only active language in translation fields

Update TranslationFields to render a single input for the current locale
Ensure entity base names fallback to the active locale translation on save
This commit is contained in:
2026-05-01 14:11:31 +08:00
parent 62406bdc84
commit ca3ca35dfc
5 changed files with 63 additions and 20 deletions

View File

@@ -248,6 +248,14 @@ function configBaseNameForSave() {
return configForm.value.translations[currentConfigLocale.value]?.name ?? '';
}
function checklistTitleForSave() {
if (checklistForm.value.title.trim() !== '') {
return checklistForm.value.title;
}
return checklistForm.value.translations[currentConfigLocale.value]?.title ?? '';
}
function previewChecklistOrder(rows: DailyChecklistItem[]) {
checklistRows.value = rows;
}
@@ -391,7 +399,7 @@ async function loadChecklist() {
async function saveChecklistItem() {
await run(async () => {
const payload = {
title: checklistForm.value.title,
title: checklistTitleForSave(),
translations: checklistForm.value.translations
};