Skip to content

Commit 66165ad

Browse files
authored
Add missing translations - fix mixed translations issue (buerokratt#241)
1 parent a0588d1 commit 66165ad

File tree

7 files changed

+146
-124
lines changed

7 files changed

+146
-124
lines changed

GUI/src/components/Header/index.tsx

+116-116
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,10 @@ const Header: FC = () => {
119119
() =>
120120
activeChatsList
121121
? activeChatsList.filter(
122-
(c) =>
123-
c.status === CHAT_STATUS.REDIRECTED &&
124-
c.customerSupportId === userInfo?.idCode
125-
).length
122+
(c) =>
123+
c.status === CHAT_STATUS.REDIRECTED &&
124+
c.customerSupportId === userInfo?.idCode
125+
).length
126126
: 0,
127127
[activeChatsList]
128128
);
@@ -136,17 +136,17 @@ const Header: FC = () => {
136136
// TODO send email notification
137137
toast.open({
138138
type: 'info',
139-
title: t('settings.users.newUnansweredChat'),
140-
message: '',
139+
title: t('global.notification'),
140+
message: t('settings.users.newUnansweredChat'),
141141
});
142142
}
143143
subscription = interval(2 * 60 * 1000).subscribe(() => {
144144
if (userProfileSettings.newChatSoundNotifications) audio.play();
145145
if (userProfileSettings.newChatPopupNotifications) {
146146
toast.open({
147147
type: 'info',
148-
title: t('settings.users.newUnansweredChat'),
149-
message: '',
148+
title: t('global.notification'),
149+
message: t('settings.users.newUnansweredChat'),
150150
});
151151
}
152152
});
@@ -166,17 +166,17 @@ const Header: FC = () => {
166166
// TODO send email notification
167167
toast.open({
168168
type: 'info',
169-
title: t('settings.users.newForwardedChat'),
170-
message: '',
169+
title: t('global.notification'),
170+
message: t('settings.users.newForwardedChat'),
171171
});
172172
}
173173
subscription = interval(2 * 60 * 1000).subscribe(() => {
174174
if (userProfileSettings.forwardedChatSoundNotifications) audio.play();
175175
if (userProfileSettings.forwardedChatPopupNotifications) {
176176
toast.open({
177177
type: 'info',
178-
title: t('settings.users.newForwardedChat'),
179-
message: '',
178+
title: t('global.notification'),
179+
message: t('settings.users.newForwardedChat'),
180180
});
181181
}
182182
});
@@ -280,7 +280,7 @@ const Header: FC = () => {
280280
customerSupportActive: csaActive,
281281
customerSupportId: customerSupportActivity.idCode,
282282
customerSupportStatus: 'online',
283-
});
283+
});
284284
};
285285

286286
const { getRemainingTime } = useIdleTimer({
@@ -464,109 +464,109 @@ const Header: FC = () => {
464464
AUTHORITY.CUSTOMER_SUPPORT_AGENT,
465465
AUTHORITY.SERVICE_MANAGER,
466466
].some((auth) => userInfo.authorities.includes(auth)) && (
467-
<>
468-
<Section>
469-
<Track gap={8} direction="vertical" align="left">
470-
<p className="h6">{t('settings.users.autoCorrector')}</p>
471-
<SwitchBox
472-
name="useAutocorrect"
473-
label={t('settings.users.useAutocorrect')}
474-
checked={userProfileSettings.useAutocorrect}
475-
onCheckedChange={(checked) =>
476-
handleUserProfileSettingsChange('useAutocorrect', checked)
477-
}
478-
/>
479-
</Track>
480-
</Section>
481-
<Section>
482-
<Track gap={8} direction="vertical" align="left">
483-
<p className="h6">{t('settings.users.emailNotifications')}</p>
484-
<SwitchBox
485-
name="forwardedChatEmailNotifications"
486-
label={t('settings.users.newForwardedChat')}
487-
checked={
488-
userProfileSettings.forwardedChatEmailNotifications
489-
}
490-
onCheckedChange={(checked) =>
491-
handleUserProfileSettingsChange(
492-
'forwardedChatEmailNotifications',
493-
checked
494-
)
495-
}
496-
/>
497-
<SwitchBox
498-
name="newChatEmailNotifications"
499-
label={t('settings.users.newUnansweredChat')}
500-
checked={userProfileSettings.newChatEmailNotifications}
501-
onCheckedChange={(checked) =>
502-
handleUserProfileSettingsChange(
503-
'newChatEmailNotifications',
504-
checked
505-
)
506-
}
507-
/>
508-
</Track>
509-
</Section>
510-
<Section>
511-
<Track gap={8} direction="vertical" align="left">
512-
<p className="h6">{t('settings.users.soundNotifications')}</p>
513-
<SwitchBox
514-
name="forwardedChatSoundNotifications"
515-
label={t('settings.users.newForwardedChat')}
516-
checked={
517-
userProfileSettings.forwardedChatSoundNotifications
518-
}
519-
onCheckedChange={(checked) =>
520-
handleUserProfileSettingsChange(
521-
'forwardedChatSoundNotifications',
522-
checked
523-
)
524-
}
525-
/>
526-
<SwitchBox
527-
name="newChatSoundNotifications"
528-
label={t('settings.users.newUnansweredChat')}
529-
checked={userProfileSettings.newChatSoundNotifications}
530-
onCheckedChange={(checked) =>
531-
handleUserProfileSettingsChange(
532-
'newChatSoundNotifications',
533-
checked
534-
)
535-
}
536-
/>
537-
</Track>
538-
</Section>
539-
<Section>
540-
<Track gap={8} direction="vertical" align="left">
541-
<p className="h6">{t('settings.users.popupNotifications')}</p>
542-
<SwitchBox
543-
name="forwardedChatPopupNotifications"
544-
label={t('settings.users.newForwardedChat')}
545-
checked={
546-
userProfileSettings.forwardedChatPopupNotifications
547-
}
548-
onCheckedChange={(checked) =>
549-
handleUserProfileSettingsChange(
550-
'forwardedChatPopupNotifications',
551-
checked
552-
)
553-
}
554-
/>
555-
<SwitchBox
556-
name="newChatPopupNotifications"
557-
label={t('settings.users.newUnansweredChat')}
558-
checked={userProfileSettings.newChatPopupNotifications}
559-
onCheckedChange={(checked) =>
560-
handleUserProfileSettingsChange(
561-
'newChatPopupNotifications',
562-
checked
563-
)
564-
}
565-
/>
566-
</Track>
567-
</Section>
568-
</>
569-
)}
467+
<>
468+
<Section>
469+
<Track gap={8} direction="vertical" align="left">
470+
<p className="h6">{t('settings.users.autoCorrector')}</p>
471+
<SwitchBox
472+
name="useAutocorrect"
473+
label={t('settings.users.useAutocorrect')}
474+
checked={userProfileSettings.useAutocorrect}
475+
onCheckedChange={(checked) =>
476+
handleUserProfileSettingsChange('useAutocorrect', checked)
477+
}
478+
/>
479+
</Track>
480+
</Section>
481+
<Section>
482+
<Track gap={8} direction="vertical" align="left">
483+
<p className="h6">{t('settings.users.emailNotifications')}</p>
484+
<SwitchBox
485+
name="forwardedChatEmailNotifications"
486+
label={t('settings.users.newForwardedChat')}
487+
checked={
488+
userProfileSettings.forwardedChatEmailNotifications
489+
}
490+
onCheckedChange={(checked) =>
491+
handleUserProfileSettingsChange(
492+
'forwardedChatEmailNotifications',
493+
checked
494+
)
495+
}
496+
/>
497+
<SwitchBox
498+
name="newChatEmailNotifications"
499+
label={t('settings.users.newUnansweredChat')}
500+
checked={userProfileSettings.newChatEmailNotifications}
501+
onCheckedChange={(checked) =>
502+
handleUserProfileSettingsChange(
503+
'newChatEmailNotifications',
504+
checked
505+
)
506+
}
507+
/>
508+
</Track>
509+
</Section>
510+
<Section>
511+
<Track gap={8} direction="vertical" align="left">
512+
<p className="h6">{t('settings.users.soundNotifications')}</p>
513+
<SwitchBox
514+
name="forwardedChatSoundNotifications"
515+
label={t('settings.users.newForwardedChat')}
516+
checked={
517+
userProfileSettings.forwardedChatSoundNotifications
518+
}
519+
onCheckedChange={(checked) =>
520+
handleUserProfileSettingsChange(
521+
'forwardedChatSoundNotifications',
522+
checked
523+
)
524+
}
525+
/>
526+
<SwitchBox
527+
name="newChatSoundNotifications"
528+
label={t('settings.users.newUnansweredChat')}
529+
checked={userProfileSettings.newChatSoundNotifications}
530+
onCheckedChange={(checked) =>
531+
handleUserProfileSettingsChange(
532+
'newChatSoundNotifications',
533+
checked
534+
)
535+
}
536+
/>
537+
</Track>
538+
</Section>
539+
<Section>
540+
<Track gap={8} direction="vertical" align="left">
541+
<p className="h6">{t('settings.users.popupNotifications')}</p>
542+
<SwitchBox
543+
name="forwardedChatPopupNotifications"
544+
label={t('settings.users.newForwardedChat')}
545+
checked={
546+
userProfileSettings.forwardedChatPopupNotifications
547+
}
548+
onCheckedChange={(checked) =>
549+
handleUserProfileSettingsChange(
550+
'forwardedChatPopupNotifications',
551+
checked
552+
)
553+
}
554+
/>
555+
<SwitchBox
556+
name="newChatPopupNotifications"
557+
label={t('settings.users.newUnansweredChat')}
558+
checked={userProfileSettings.newChatPopupNotifications}
559+
onCheckedChange={(checked) =>
560+
handleUserProfileSettingsChange(
561+
'newChatPopupNotifications',
562+
checked
563+
)
564+
}
565+
/>
566+
</Track>
567+
</Section>
568+
</>
569+
)}
570570
</Drawer>
571571
)}
572572
</>

GUI/src/pages/Chat/ChatActive/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ const ChatActive: FC = () => {
7272
toast.open({
7373
type: 'success',
7474
title: t('global.notification'),
75-
message: 'Message sent to user email',
75+
message: t('toast.success.messageToUserEmail'),
7676
});
7777
},
7878
onError: (error: AxiosError) => {

GUI/src/pages/Chat/ChatHistory/index.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ const ChatHistory: FC = () => {
9494
toast.open({
9595
type: 'success',
9696
title: t('global.notification'),
97-
message: 'Message sent to user email',
97+
message: t('toast.success.messageToUserEmail'),
9898
});
9999
},
100100
onError: (error: AxiosError) => {
@@ -143,7 +143,7 @@ const ChatHistory: FC = () => {
143143
toast.open({
144144
type: 'success',
145145
title: t('global.notification'),
146-
message: 'Chat status changed',
146+
message: t('toast.success.chatStatusChanged'),
147147
});
148148
setStatusChangeModal(null);
149149
},
@@ -168,7 +168,7 @@ const ChatHistory: FC = () => {
168168
toast.open({
169169
type: 'success',
170170
title: t('global.notification'),
171-
message: 'Chat comment changed',
171+
message: t('toast.success.chatCommentChanged'),
172172
});
173173
},
174174
onError: (error: AxiosError) => {
@@ -188,7 +188,7 @@ const ChatHistory: FC = () => {
188188
toast.open({
189189
type: 'success',
190190
title: t('global.notification'),
191-
message: 'Copied',
191+
message: t('toast.succes.copied'),
192192
});
193193
}
194194

GUI/src/pages/Settings/SettingsUsers/UserModal.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ const UserModal: FC<UserModalProps> = ({ onClose, user }) => {
6565
toast.open({
6666
type: 'success',
6767
title: t('global.notification'),
68-
message: 'New user added',
68+
message: t('toast.succes.newUserAdded'),
6969
});
7070
onClose();
7171
},
@@ -94,7 +94,7 @@ const UserModal: FC<UserModalProps> = ({ onClose, user }) => {
9494
toast.open({
9595
type: 'success',
9696
title: t('global.notification'),
97-
message: 'User updated',
97+
message: t('toast.success.userUpdated'),
9898
});
9999
onClose();
100100
},

GUI/src/pages/Settings/SettingsUsers/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const SettingsUsers: FC = () => {
3434
toast.open({
3535
type: 'success',
3636
title: t('global.notification'),
37-
message: 'User deleted',
37+
message: t('toast.success.userDeleted'),
3838
});
3939
setDeletableRow(null);
4040
},

GUI/translations/en/common.json

+11
Original file line numberDiff line numberDiff line change
@@ -273,5 +273,16 @@
273273
"daysAgo": "{{days}} ago",
274274
"uptimePercent": "{{percent}}% uptime"
275275
}
276+
},
277+
"toast": {
278+
"success": {
279+
"messageToUserEmail": "Message sent to user email",
280+
"chatStatusChanged": "Chat status changed",
281+
"chatCommentChanged": "Chat comment changed",
282+
"copied": "Copied",
283+
"userDeleted": "User deleted",
284+
"newUserAdded": "New user added",
285+
"userUpdated": "User updated"
286+
}
276287
}
277288
}

GUI/translations/et/common.json

+11
Original file line numberDiff line numberDiff line change
@@ -273,5 +273,16 @@
273273
"daysAgo": "{{days}} päeva tagasi",
274274
"uptimePercent": "{{percent}}% tööaeg"
275275
}
276+
},
277+
"toast": {
278+
"success": {
279+
"messageToUserEmail": "Sõnum saadeti kasutaja emailile",
280+
"chatStatusChanged": "Vestluse staatus muudetud",
281+
"chatCommentChanged": "Vestluse kommentaar muudetud",
282+
"copied": "Kopeeritud",
283+
"userDeleted": "Kasutaja kustutatud",
284+
"newUserAdded": "Uus kasutaja lisatud",
285+
"userUpdated": "Kasutaja uuendatud"
286+
}
276287
}
277288
}

0 commit comments

Comments
 (0)