Skip to content

Commit

Permalink
Use gettext for localization
Browse files Browse the repository at this point in the history
  • Loading branch information
QazCetelic committed Oct 20, 2023
1 parent 20948ab commit e6c27e4
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions pkg/systemd/bootInfo.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import {
import "./bootInfo.scss";
import { EmptyState, EmptyStateBody } from "@patternfly/react-core/dist/esm/components/EmptyState";

const _ = cockpit.gettext;

export function BootInfo() {
const [svg, setSvg] = useState(undefined);
const [summary, setSummary] = useState(null);
Expand Down Expand Up @@ -59,7 +61,7 @@ export function BootInfo() {
return (
<div className="pf-v5-c-page__main-section">
<EmptyState variant={EmptyStateVariant.xs}>
<EmptyStateHeader titleText="Loading" headingLevel="h4" />
<EmptyStateHeader titleText={_("Loading")} headingLevel="h4" />
<EmptyStateBody>
<Spinner size="xl" />
</EmptyStateBody>
Expand All @@ -72,10 +74,10 @@ export function BootInfo() {
return (
<div className="pf-v5-c-page__main-section">
<EmptyState variant={EmptyStateVariant.xs}>
<EmptyStateHeader titleText="Failure" headingLevel="h4" />
<EmptyStateHeader titleText={_("Failure")} headingLevel="h4" />
<EmptyStateBody>
Are you sure systemd-analyze is available?
systemd-analyze failed to load boot info and returned the following error:
{_("Are you sure systemd-analyze is available?")}
{_("systemd-analyze failed to load boot info and returned the following error:")}
<CodeBlock>
<CodeBlockCode id="code-content">{summary.toString()}</CodeBlockCode>
</CodeBlock>
Expand All @@ -95,35 +97,35 @@ export function BootInfo() {
return (
<div className="pf-v5-c-page__main-section">
<Card>
<CardTitle>Boot Info</CardTitle>
<CardTitle>{ _("Boot Info") }</CardTitle>
<CardBody>
<p>
{summary}
</p>
<List className="legend" isPlain variant={ListVariant.inline}>
<ListItem>
<div className="legendColor activating" />
Activating
{ _("Activating") }
</ListItem>
<ListItem>
<div className="legendColor active" />
Active
{ _("Active") }
</ListItem>
<ListItem>
<div className="legendColor deactivating" />
Deactivating
{ _("Deactivating") }
</ListItem>
<ListItem>
<div className="legendColor security" />
Setting up security module
{ _("Setting up security module") }
</ListItem>
<ListItem>
<div className="legendColor generators" />
Generators
{ _("Generators") }
</ListItem>
<ListItem>
<div className="legendColor unitsload" />
Loading unit files
{ _("Loading unit files") }
</ListItem>
</List>
<div className="chart-container">
Expand Down

0 comments on commit e6c27e4

Please sign in to comment.