forked from sombochea/verdaccio-ui
feat(i18n): added i18next for user interface translations (#432)
This commit is contained in:
committed by
GitHub
parent
8d4b3cee7e
commit
7428384b55
@@ -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 };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user