Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(web): fix localization of overview headers #1645

Merged
merged 4 commits into from
Sep 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions web/package/agama-web-ui.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Fri Sep 27 14:54:46 UTC 2024 - Imobach Gonzalez Sosa <igonzalezsosa@suse.com>

- Translate overview page headers and a missing text in the
networking page (gh#agama-project/agama#1629).

-------------------------------------------------------------------
Fri Sep 27 13:00:05 UTC 2024 - Imobach Gonzalez Sosa <igonzalezsosa@suse.com>

Expand Down
2 changes: 1 addition & 1 deletion web/src/components/network/WifiNetworksListPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ function WifiNetworksListPage() {
<DrawerContentBody>
<Stack hasGutter>
{networks.length === 0 ? (
<EmptyState title="No visible Wi-Fi networks found" icon="error" />
<EmptyState title={_("No visible Wi-Fi networks found")} icon="error" />
) : (
// @ts-expect-error: related to https://github.com/patternfly/patternfly-react/issues/9823
<DataList
Expand Down
16 changes: 8 additions & 8 deletions web/src/components/overview/OverviewPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,6 @@ import { _ } from "~/i18n";
import { useAllIssues } from "~/queries/issues";
import { IssuesList as IssuesListType, IssueSeverity } from "~/types/issues";

const SCOPE_HEADERS = {
users: _("Users"),
storage: _("Storage"),
software: _("Software"),
};

const ReadyForInstallation = () => (
<Center>
<EmptyState title={_("Ready for installation")} icon="check_circle" color="success-color-100">
Expand All @@ -59,6 +53,12 @@ const ReadyForInstallation = () => (
);

const IssuesList = ({ issues }: { issues: IssuesListType }) => {
const scopeHeaders = {
users: _("Users"),
storage: _("Storage"),
software: _("Software"),
};

const { issues: issuesByScope } = issues;
const list = [];
Object.entries(issuesByScope).forEach(([scope, issues], idx) => {
Expand All @@ -68,7 +68,7 @@ const IssuesList = ({ issues }: { issues: IssuesListType }) => {
const link = (
<NotificationDrawerListItem key={`${idx}-${subIdx}`} variant={variant} isHoverable={false}>
<NotificationDrawerListItemHeader
title={SCOPE_HEADERS[scope]}
title={scopeHeaders[scope]}
variant={variant}
headingLevel="h4"
/>
Expand Down Expand Up @@ -109,7 +109,7 @@ const ResultSection = () => {

const OverviewSection = () => (
<Page.Section
title="Overview"
title={_("Overview")}
description={_(
"These are the most relevant installation settings. Feel free to browse the sections in the menu for further details.",
)}
Expand Down
Loading