mirror of
https://github.com/kremalicious/umami.git
synced 2024-12-18 15:23:38 +01:00
Added missing messages.
This commit is contained in:
parent
ff854150ae
commit
ccca5d2d99
@ -18,10 +18,10 @@ const validate = ({ username, password }) => {
|
|||||||
const errors = {};
|
const errors = {};
|
||||||
|
|
||||||
if (!username) {
|
if (!username) {
|
||||||
errors.username = 'Required';
|
errors.username = <FormattedMessage id="label.required" defaultMessage="Required" />;
|
||||||
}
|
}
|
||||||
if (!password) {
|
if (!password) {
|
||||||
errors.password = 'Required';
|
errors.password = <FormattedMessage id="label.required" defaultMessage="Required" />;
|
||||||
}
|
}
|
||||||
|
|
||||||
return errors;
|
return errors;
|
||||||
@ -36,7 +36,16 @@ export default function LoginForm() {
|
|||||||
if (typeof response !== 'string') {
|
if (typeof response !== 'string') {
|
||||||
await Router.push('/');
|
await Router.push('/');
|
||||||
} else {
|
} else {
|
||||||
setMessage(response.startsWith('401') ? 'Incorrect username/password' : response);
|
setMessage(
|
||||||
|
response.startsWith('401') ? (
|
||||||
|
<FormattedMessage
|
||||||
|
id="message.incorrect-username-password"
|
||||||
|
defaultMessage="Incorrect username/password."
|
||||||
|
/>
|
||||||
|
) : (
|
||||||
|
response
|
||||||
|
),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ import { FormattedMessage } from 'react-intl';
|
|||||||
export default function OSTable({ websiteId, limit, onExpand }) {
|
export default function OSTable({ websiteId, limit, onExpand }) {
|
||||||
return (
|
return (
|
||||||
<MetricsTable
|
<MetricsTable
|
||||||
title={<FormattedMessage id="metrics.operating-system" defaultMessage="Operating System" />}
|
title={<FormattedMessage id="metrics.operating-system" defaultMessage="Operating system" />}
|
||||||
type="os"
|
type="os"
|
||||||
metric={<FormattedMessage id="metrics.visitors" defaultMessage="Visitors" />}
|
metric={<FormattedMessage id="metrics.visitors" defaultMessage="Visitors" />}
|
||||||
websiteId={websiteId}
|
websiteId={websiteId}
|
||||||
|
@ -122,6 +122,9 @@
|
|||||||
"message.failure": {
|
"message.failure": {
|
||||||
"defaultMessage": "Something went wrong."
|
"defaultMessage": "Something went wrong."
|
||||||
},
|
},
|
||||||
|
"message.incorrect-username-password": {
|
||||||
|
"defaultMessage": "Incorrect username/password."
|
||||||
|
},
|
||||||
"message.save-success": {
|
"message.save-success": {
|
||||||
"defaultMessage": "Saved successfully."
|
"defaultMessage": "Saved successfully."
|
||||||
},
|
},
|
||||||
@ -165,7 +168,7 @@
|
|||||||
"defaultMessage": "Raw"
|
"defaultMessage": "Raw"
|
||||||
},
|
},
|
||||||
"metrics.operating-system": {
|
"metrics.operating-system": {
|
||||||
"defaultMessage": "Operating System"
|
"defaultMessage": "Operating system"
|
||||||
},
|
},
|
||||||
"metrics.page-views": {
|
"metrics.page-views": {
|
||||||
"defaultMessage": "Page views"
|
"defaultMessage": "Page views"
|
||||||
|
@ -122,6 +122,9 @@
|
|||||||
"message.failure": {
|
"message.failure": {
|
||||||
"defaultMessage": "出现错误."
|
"defaultMessage": "出现错误."
|
||||||
},
|
},
|
||||||
|
"message.incorrect-username-password": {
|
||||||
|
"defaultMessage": "用户名密码不正确."
|
||||||
|
},
|
||||||
"message.save-success": {
|
"message.save-success": {
|
||||||
"defaultMessage": "成功保存."
|
"defaultMessage": "成功保存."
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user