mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-07 22:15:45 +01:00
added translation
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import { translate } from "react-i18next";
|
import { translate } from "react-i18next";
|
||||||
import Notification from "./Notification";
|
import Notification from "./Notification";
|
||||||
|
import {UNAUTHORIZED_ERROR} from "./apiclient";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
t: string => string,
|
t: string => string,
|
||||||
@@ -9,15 +10,27 @@ type Props = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
class ErrorNotification extends React.Component<Props> {
|
class ErrorNotification extends React.Component<Props> {
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { t, error } = this.props;
|
const { t, error } = this.props;
|
||||||
if (error) {
|
if (error) {
|
||||||
|
if (error === UNAUTHORIZED_ERROR) {
|
||||||
|
return (
|
||||||
|
<Notification type="danger">
|
||||||
|
<strong>{t("error-notification.prefix")}:</strong> {t("error-notification.timeout")}
|
||||||
|
{" "}
|
||||||
|
<a href="javascript:window.location.reload(true)">{t("error-notification.loginLink")}</a>
|
||||||
|
</Notification>
|
||||||
|
);
|
||||||
|
} else {
|
||||||
return (
|
return (
|
||||||
<Notification type="danger">
|
<Notification type="danger">
|
||||||
<strong>{t("error-notification.prefix")}:</strong> {error.message}
|
<strong>{t("error-notification.prefix")}:</strong> {error.message}
|
||||||
</Notification>
|
</Notification>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"error-notification": {
|
"error-notification": {
|
||||||
"prefix": "Error"
|
"prefix": "Error",
|
||||||
|
"loginLink": "You can login here again.",
|
||||||
|
"timeout": "The session has expired."
|
||||||
},
|
},
|
||||||
"loading": {
|
"loading": {
|
||||||
"alt": "Loading ..."
|
"alt": "Loading ..."
|
||||||
|
|||||||
Reference in New Issue
Block a user