{
- cockpit.format(
+ format(
// TRANSLATORS: content of the "About" popup (2/2)
- // $0 is replaced by the project URL
- _("For more information, please visit the project's repository at $0."),
+ // %s is replaced by the project URL
+ _("For more information, please visit the project's repository at %s."),
"https://github.com/openSUSE/agama"
)
}
diff --git a/web/src/components/core/ValidationErrors.jsx b/web/src/components/core/ValidationErrors.jsx
index 9342a18e68..c34aba1bec 100644
--- a/web/src/components/core/ValidationErrors.jsx
+++ b/web/src/components/core/ValidationErrors.jsx
@@ -29,12 +29,11 @@ import {
ListItem,
Popover
} from "@patternfly/react-core";
+import format from "format-util";
import { Icon } from '~/components/layout';
import { _, n_ } from "~/i18n";
-import cockpit from "~/lib/cockpit";
-
/**
* @param {import("~/client/mixins").ValidationError[]} errors - Validation errors
* @return React.JSX
@@ -82,9 +81,9 @@ const ValidationErrors = ({ title = _("Errors"), errors }) => {
onClick={() => setPopoverVisible(true)}
>
{ warningIcon } {
- cockpit.format(
- // TRANSLATORS: $0 is replaced with the number of errors found
- n_("$0 error found", "$0 errors found", errors.length),
+ format(
+ // TRANSLATORS: %d is replaced with the number of errors found
+ n_("%d error found", "%d errors found", errors.length),
errors.length
)
}
diff --git a/web/src/components/network/ConnectionsTable.jsx b/web/src/components/network/ConnectionsTable.jsx
index f795fc6265..80e2ff7aa7 100644
--- a/web/src/components/network/ConnectionsTable.jsx
+++ b/web/src/components/network/ConnectionsTable.jsx
@@ -21,13 +21,13 @@
import React from "react";
import { TableComposable, Thead, Tr, Th, Tbody, Td } from '@patternfly/react-table';
+import format from "format-util";
+
import { RowActions } from "~/components/core";
import { Icon } from "~/components/layout";
import { formatIp } from "~/client/network/utils";
import { _ } from "~/i18n";
-import cockpit from "~/lib/cockpit";
-
/**
* @typedef {import("~/client/network/model").Connection} Connection
*/
@@ -66,15 +66,15 @@ export default function ConnectionsTable ({
{
title: _("Edit"),
"aria-label":
- // TRANSLATORS: $0 is replaced by a network connection name
- cockpit.format(_("Edit connection $0"), connection.name),
+ // TRANSLATORS: %s is replaced by a network connection name
+ format(_("Edit connection %s"), connection.name),
onClick: () => onEdit(connection)
},
typeof onForget === 'function' && {
title: _("Forget"),
"aria-label":
- // TRANSLATORS: $0 is replaced by a network connection name
- cockpit.format(_("Forget connection $0"), connection.name),
+ // TRANSLATORS: %s is replaced by a network connection name
+ format(_("Forget connection %s"), connection.name),
className: "danger-action",
icon: ,
onClick: () => onForget(connection)
@@ -88,8 +88,8 @@ export default function ConnectionsTable ({
diff --git a/web/src/components/network/IpSettingsForm.jsx b/web/src/components/network/IpSettingsForm.jsx
index 42b6d1db45..2a61cf8c5e 100644
--- a/web/src/components/network/IpSettingsForm.jsx
+++ b/web/src/components/network/IpSettingsForm.jsx
@@ -21,14 +21,13 @@
import React, { useState } from "react";
import { HelperText, HelperTextItem, Form, FormGroup, FormSelect, FormSelectOption, TextInput } from "@patternfly/react-core";
+import format from "format-util";
import { useInstallerClient } from "~/context/installer";
import { Popup } from "~/components/core";
import { AddressesDataList, DnsDataList } from "~/components/network";
import { _ } from "~/i18n";
-import cockpit from "~/lib/cockpit";
-
const METHODS = {
MANUAL: "manual",
AUTO: "auto"
@@ -127,8 +126,9 @@ export default function IpSettingsForm({ connection, onClose }) {
};
// TRANSLATORS: manual network configuration mode with a static IP address
+ // %s is replaced by the connection name
return (
-
+
|