File tree Expand file tree Collapse file tree 4 files changed +38
-13
lines changed Expand file tree Collapse file tree 4 files changed +38
-13
lines changed Original file line number Diff line number Diff line change @@ -171,11 +171,9 @@ const CreateProfilePage: NextPage = () => {
171
171
. catch ( ( err ) => {
172
172
log . error ( "Error creating profile:" , err ) ;
173
173
174
- // TODO: Add localizations
175
174
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" ) ,
179
177
} ) ;
180
178
} ) ;
181
179
} ;
Original file line number Diff line number Diff line change @@ -96,25 +96,24 @@ const EditProfilePage: NextPage = () => {
96
96
</ Tooltip >
97
97
) ) ;
98
98
99
- // TODO: Add translations
100
99
const handleEdit = ( ) => {
101
100
updateProfileFromDatabase (
102
101
{ ...form . values , updatedAt : Date . now ( ) } ,
103
102
form . values . uuid
104
103
)
105
104
. then ( ( ) => {
106
105
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" ) ,
109
108
} ) ;
110
109
111
110
void router . push ( `/${ locale } /profile` ) ;
112
111
} )
113
- . catch ( ( e ) => {
114
- // TODO: Show a better error message
112
+ . catch ( ( err ) => {
113
+ log . error ( "Failed to updated profile. Error:" , err ) ;
115
114
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" ) ,
118
117
} ) ;
119
118
} ) ;
120
119
} ;
Original file line number Diff line number Diff line change 55
55
"photoUpload" : " Bild auswählen" ,
56
56
"webcam" : " Webcam" ,
57
57
"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
+ }
59
73
}
Original file line number Diff line number Diff line change 55
55
"photoUpload" : " Select Photo" ,
56
56
"webcam" : " Webcam" ,
57
57
"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
+ }
59
73
}
You can’t perform that action at this time.
0 commit comments