Skip to content

Commit

Permalink
Provide feedback after Vernacular name change (#3408)
Browse files Browse the repository at this point in the history
Resolves #2661
  • Loading branch information
andracc authored Oct 25, 2024
1 parent ceaf711 commit 55384c3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions public/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
8 changes: 7 additions & 1 deletion src/components/ProjectSettings/ProjectLanguages.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ export default function ProjectLanguages(
setAdd(false);
setLangsInProj("");
setNewLang(newWritingSystem());
setChangeVernName(false);
};

const updateVernacularName = async (): Promise<void> => {
Expand All @@ -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(
Expand Down

0 comments on commit 55384c3

Please sign in to comment.