From 55384c343d8e5f2e7bb38f3ccb54d318bd9c3ff9 Mon Sep 17 00:00:00 2001 From: Andra <78518344+andracc@users.noreply.github.com> Date: Fri, 25 Oct 2024 10:38:50 -0400 Subject: [PATCH] Provide feedback after Vernacular name change (#3408) Resolves #2661 --- public/locales/en/translation.json | 1 + src/components/ProjectSettings/ProjectLanguages.tsx | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/public/locales/en/translation.json b/public/locales/en/translation.json index 5f2b8a25f9..7e757db4b4 100644 --- a/public/locales/en/translation.json +++ b/public/locales/en/translation.json @@ -182,6 +182,7 @@ "deleteAnalysisLanguage": "Delete this analysis language", "getGlossLanguages": "Find all language codes used in the current data", "updateVernacularLanguageNameFailed": "Failed to update vernacular language name", + "updateVernacularLanguageNameSuccess": "Vernacular language updated!", "addAnalysisLanguageFailed": "Failed to add analysis language", "makeDefaultAnalysisLanguageFailed": "Failed to make default analysis language", "deleteAnalysisLanguageFailed": "Failed to delete analysis language", diff --git a/src/components/ProjectSettings/ProjectLanguages.tsx b/src/components/ProjectSettings/ProjectLanguages.tsx index fff0870d58..f3894436d4 100644 --- a/src/components/ProjectSettings/ProjectLanguages.tsx +++ b/src/components/ProjectSettings/ProjectLanguages.tsx @@ -142,6 +142,7 @@ export default function ProjectLanguages( setAdd(false); setLangsInProj(""); setNewLang(newWritingSystem()); + setChangeVernName(false); }; const updateVernacularName = async (): Promise => { @@ -158,7 +159,12 @@ export default function ProjectLanguages( }; await props .setProject({ ...props.project, vernacularWritingSystem }) - .then(() => resetState()) + .then(() => { + resetState(); + toast.success( + t("projectSettings.language.updateVernacularLanguageNameSuccess") + ); + }) .catch((err) => { console.error(err); toast.error(