feat(i18n): added i18next for user interface translations (#432)

This commit is contained in:
Priscila Oliveira
2020-03-08 16:45:07 +01:00
committed by GitHub
parent 8d4b3cee7e
commit 7428384b55
76 changed files with 1114 additions and 720 deletions

View File

@@ -2,6 +2,7 @@ import isString from 'lodash/isString';
import isNumber from 'lodash/isNumber';
import isEmpty from 'lodash/isEmpty';
import { Base64 } from 'js-base64';
import i18next from 'i18next';
import { HEADERS } from '../../lib/constants';
@@ -56,7 +57,7 @@ export async function makeLogin(username?: string, password?: string): Promise<L
if (isEmpty(username) || isEmpty(password)) {
const error = {
type: 'error',
description: "Username or password can't be empty!",
description: i18next.t('form-validation.username-or-password-cant-be-empty'),
};
return { error };
}
@@ -78,7 +79,7 @@ export async function makeLogin(username?: string, password?: string): Promise<L
console.error('login error', e.message);
const error = {
type: 'error',
description: 'Unable to sign in',
description: i18next.t('form-validation.unable-to-sign-in'),
};
return { error };
}