feat(GlobalErrors): localize the global errors.

This commit is contained in:
a.bouhuolia
2022-01-03 18:31:52 +02:00
parent fa25fb4ede
commit 5c7ac0593d
3 changed files with 15 additions and 8 deletions

View File

@@ -43,7 +43,7 @@ function GlobalErrors({
if (globalErrors.access_denied) {
toastKeySomethingWrong = AppToaster.show(
{
message: 'You do not have permissions to access this page.',
message: intl.get('global_error.you_dont_have_permissions'),
intent: Intent.DANGER,
onDismiss: () => {
globalErrorsSet({ access_denied: false });
@@ -53,11 +53,10 @@ function GlobalErrors({
);
}
if (globalErrors.transactionsLocked) {
const lockedToDate =
globalErrors.transactionsLocked.formatted_locked_to_date;
AppToaster.show({
message: `Transactions before ${lockedToDate} has been locked. Hence action cannot be performed.`,
message: intl.get('global_error.transactions_locked', {
lockedToDate: globalErrors.transactionsLocked.formatted_locked_to_date,
}),
intent: Intent.DANGER,
onDismiss: () => {
globalErrorsSet({ transactionsLocked: false });
@@ -66,7 +65,7 @@ function GlobalErrors({
}
if (globalErrors.userInactive) {
AppToaster.show({
message: 'The authorized user is inactive.',
message: intl.get('global_error.authorized_user_inactive'),
intent: Intent.DANGER,
onDismiss: () => {
globalErrorsSet({ userInactive: false });