Skip to content

Commit

Permalink
Merge pull request #795 from openSUSE/devserver_translations
Browse files Browse the repository at this point in the history
DevServerWrapper translations
  • Loading branch information
lslezak authored Oct 10, 2023
2 parents 6a6c194 + f688733 commit ea4edd3
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 11 deletions.
2 changes: 1 addition & 1 deletion web/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"overrides": [
{
// do not check translations in the testing or development files
"files": ["*.test.*", "test-utils.js", "DevServerWrapper.jsx"],
"files": ["*.test.*", "test-utils.js"],
"rules": {
"i18next/no-literal-string": "off"
}
Expand Down
17 changes: 11 additions & 6 deletions web/src/DevServerWrapper.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import {
EmptyState, EmptyStateBody, EmptyStateFooter, EmptyStateHeader, EmptyStateIcon
} from "@patternfly/react-core";
import { Center, Icon, Loading } from "~/components/layout";
import { _ } from "~/i18n";

// path to any internal Cockpit component to force displaying the login dialog
const loginPath = "/cockpit/@localhost/system/terminal.html";
Expand Down Expand Up @@ -77,26 +78,30 @@ export default function DevServerWrapper({ children }) {
if (isLoading) return <Loading />;

if (isError) {
// TRANSLATORS: error message, %s is replaced by the server URL
const [msg1, msg2] = _("The server at %s is not reachable.").split("%s");
return (
<Center>
<EmptyState variant="xl">
<EmptyStateHeader
titleText="Cannot connect to the Cockpit server"
// TRANSLATORS: error message
titleText={_("Cannot connect to the Cockpit server")}
headingLevel="h2"
icon={<EmptyStateIcon icon={ErrorIcon} />}
/>
<EmptyStateBody>
<Text>
The server at { " " }
<Button isInline variant="link" component="a" href={ COCKPIT_TARGET_URL } target="_blank">
{ COCKPIT_TARGET_URL }
{msg1} {" "}
<Button isInline variant="link" component="a" href={COCKPIT_TARGET_URL} target="_blank">
{COCKPIT_TARGET_URL}
</Button>
{ " " } is not reachable.
{" "} {msg2}
</Text>
</EmptyStateBody>
<EmptyStateFooter>
<Button variant="primary" onClick={() => { setIsLoading(true); setIsError(false) }}>
Try Again
{/* TRANSLATORS: button label */}
{_("Try Again")}
</Button>
</EmptyStateFooter>
</EmptyState>
Expand Down
8 changes: 4 additions & 4 deletions web/src/components/core/InstallButton.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ before proceeding with the installation.").split(/[[\]]/);
<div className="stack">
<If condition={hasIssues} then={<IssuesWarning />} />
<p>
{ _(`If you continue, partitions on your hard disk will be modified
according to the provided installation settings.`) }
{ _("If you continue, partitions on your hard disk will be modified \
according to the provided installation settings.") }
</p>
<p>
{_("Please, cancel and check the settings if you are unsure.")}
Expand All @@ -87,8 +87,8 @@ const CannotInstallPopup = ({ onClose }) => (
isOpen
>
<p>
{_(`Some problems were found when trying to start the installation.
Please, have a look to the reported errors and try again.`)}
{_("Some problems were found when trying to start the installation. \
Please, have a look to the reported errors and try again.")}
</p>

<Popup.Actions>
Expand Down

0 comments on commit ea4edd3

Please sign in to comment.