Skip to content

Commit c85934f

Browse files
committed
Add missing profile creation and editing notification translations
1 parent c09192b commit c85934f

File tree

4 files changed

+38
-13
lines changed

4 files changed

+38
-13
lines changed

renderer/pages/[locale]/profile/create.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,11 +171,9 @@ const CreateProfilePage: NextPage = () => {
171171
.catch((err) => {
172172
log.error("Error creating profile:", err);
173173

174-
// TODO: Add localizations
175174
notifications.show({
176-
title: "Profile creation failed!",
177-
message:
178-
"Something went wrong while creating your profile. Please try again later.",
175+
title: t("profile:notifications.createProfileError.title"),
176+
message: t("profile:notifications.createProfileError.text"),
179177
});
180178
});
181179
};

renderer/pages/[locale]/profile/edit.tsx

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -96,25 +96,24 @@ const EditProfilePage: NextPage = () => {
9696
</Tooltip>
9797
));
9898

99-
// TODO: Add translations
10099
const handleEdit = () => {
101100
updateProfileFromDatabase(
102101
{ ...form.values, updatedAt: Date.now() },
103102
form.values.uuid
104103
)
105104
.then(() => {
106105
notifications.show({
107-
title: "Updated the profile!",
108-
message: "All done!",
106+
title: t("profile:notifications.updateProfileSuccess.title"),
107+
message: t("profile:notifications.updateProfileSuccess.text"),
109108
});
110109

111110
void router.push(`/${locale}/profile`);
112111
})
113-
.catch((e) => {
114-
// TODO: Show a better error message
112+
.catch((err) => {
113+
log.error("Failed to updated profile. Error:", err);
115114
notifications.show({
116-
title: "Unable to update the profile!",
117-
message: e as string,
115+
title: t("profile:notifications.updateProfileError.title"),
116+
message: t("profile:notifications.updateProfileError.text"),
118117
});
119118
});
120119
};

renderer/public/locales/de/profile.json

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,19 @@
5555
"photoUpload": "Bild auswählen",
5656
"webcam": "Webcam",
5757
"removePhotoUpload": "Bild entfernen",
58-
"exportProfile": "Profil exportieren"
58+
"exportProfile": "Profil exportieren",
59+
"notifications": {
60+
"updateProfileSuccess": {
61+
"title": "Profil erfolgreich aktualisiert!",
62+
"text": "Du kannst nun ein Spiel starten."
63+
},
64+
"updateProfileError": {
65+
"title": "Fehler bei der Profilaktualisierung!",
66+
"text": "Bitte versuche es später erneut."
67+
},
68+
"createProfileError": {
69+
"title": "Profil konnte nicht erstellt werden!",
70+
"text": "Bitte versuche es später erneut."
71+
}
72+
}
5973
}

renderer/public/locales/en/profile.json

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,19 @@
5555
"photoUpload": "Select Photo",
5656
"webcam": "Webcam",
5757
"removePhotoUpload": "Remove Photo",
58-
"exportProfile": "Export Profile"
58+
"exportProfile": "Export Profile",
59+
"notifications": {
60+
"updateProfileSuccess": {
61+
"title": "Profile successfully updated!",
62+
"text": "You can now start a game."
63+
},
64+
"updateProfileError": {
65+
"title": "Error updating profile!",
66+
"text": "Please try again later."
67+
},
68+
"createProfileError": {
69+
"title": "Profile could not be created!",
70+
"text": "Please try again later."
71+
}
72+
}
5973
}

0 commit comments

Comments
 (0)