diff --git a/web/src/App.jsx b/web/src/App.jsx index c5095e795c..d41c84b713 100644 --- a/web/src/App.jsx +++ b/web/src/App.jsx @@ -22,6 +22,7 @@ import React, { useEffect, useState } from "react"; import { Outlet } from "react-router-dom"; +import { _ } from "~/i18n"; import { useInstallerClient } from "~/context/installer"; import { STARTUP, INSTALL } from "~/client/phase"; import { BUSY } from "~/client/status"; @@ -86,7 +87,7 @@ function App() { - + diff --git a/web/src/components/users/FirstUser.jsx b/web/src/components/users/FirstUser.jsx index ecbf5a3f4b..ac81dc38bf 100644 --- a/web/src/components/users/FirstUser.jsx +++ b/web/src/components/users/FirstUser.jsx @@ -20,8 +20,9 @@ */ import React, { useState, useEffect } from "react"; -import { useCancellablePromise } from "~/utils"; +import { _ } from "~/i18n"; +import { useCancellablePromise } from "~/utils"; import { useInstallerClient } from "~/context/installer"; import { Alert, @@ -40,9 +41,10 @@ import { RowActions, PasswordAndConfirmationInput, Popup } from '~/components/co const UserNotDefined = ({ actionCb }) => { return (
-
No user defined yet
-
Please, be aware that a user must be defined before installing the system to be able to log into it.
- +
{_("No user defined yet")}
+
{_("Please, be aware that a user must be defined before installing the system to be able to log into it.")}
+ {/* TRANSLATORS: push button label */} +
); }; @@ -52,8 +54,8 @@ const UserData = ({ user, actions }) => { - Fullname - Username + {_("Full name")} + {_("Username")} @@ -165,11 +167,11 @@ export default function FirstUser() { const actions = [ { - title: "Edit", + title: _("Edit"), onClick: (e) => openForm(e, EDIT_MODE) }, { - title: "Discard", + title: _("Discard"), onClick: remove, className: "danger-action" } @@ -186,31 +188,31 @@ export default function FirstUser() { { isUserDefined ? : } { /* TODO: Extract this form to a component, if possible */ } { isFormOpen && - +
accept("createUser", e)}> { showErrors() && - + { errors.map((e, i) =>

{e}

) }
} - + - + @@ -218,10 +220,11 @@ export default function FirstUser() { { isEditing && } @@ -236,10 +239,11 @@ export default function FirstUser() { /> } diff --git a/web/src/components/users/RootAuthMethods.jsx b/web/src/components/users/RootAuthMethods.jsx index 26cdc69bac..798db22a33 100644 --- a/web/src/components/users/RootAuthMethods.jsx +++ b/web/src/components/users/RootAuthMethods.jsx @@ -25,17 +25,20 @@ import { TableComposable, Thead, Tr, Th, Tbody, Td } from '@patternfly/react-tab import { Em, RowActions } from '~/components/core'; import { RootPasswordPopup, RootSSHKeyPopup } from '~/components/users'; +import { _ } from "~/i18n"; import { useCancellablePromise } from "~/utils"; import { useInstallerClient } from "~/context/installer"; const MethodsNotDefined = ({ setPassword, setSSHKey }) => { return (
-
No root authentication method defined yet
-
Please, define at least one authentication method for logging into the system as root.
+
{_("No root authentication method defined yet")}
+
{_("Please, define at least one authentication method for logging into the system as root.")}
- - + {/* TRANSLATORS: push button label */} + + {/* TRANSLATORS: push button label */} +
); @@ -84,12 +87,12 @@ export default function RootAuthMethods() { const passwordActions = [ { - title: isPasswordDefined ? "Change" : "Set", + title: isPasswordDefined ? _("Change") : _("Set"), onClick: openPasswordForm }, isPasswordDefined && { - title: "Discard", + title: _("Discard"), onClick: () => client.removeRootPassword(), className: "danger-action" } @@ -97,11 +100,11 @@ export default function RootAuthMethods() { const sshKeyActions = [ { - title: isSSHKeyDefined ? "Change" : "Set", + title: isSSHKeyDefined ? _("Change") : _("Set"), onClick: openSSHKeyForm }, sshKey && { - title: "Discard", + title: _("Discard"), onClick: () => client.setRootSSHKey(""), className: "danger-action" } @@ -119,12 +122,12 @@ export default function RootAuthMethods() { const PasswordLabel = () => { return isPasswordDefined - ? "Already set" - : "Not set"; + ? _("Already set") + : _("Not set"); }; const SSHKeyLabel = () => { - if (!isSSHKeyDefined) return "Not set"; + if (!isSSHKeyDefined) return _("Not set"); const trailingChars = Math.min(sshKey.length - sshKey.lastIndexOf(" "), 30); @@ -144,21 +147,23 @@ export default function RootAuthMethods() { - Method - Status + {/* TRANSLATORS: table header, user authentication method */} + {_("Method")} + {/* TRANSLATORS: table header */} + {_("Status")} - Password + {_("Password")} - SSH Key + {_("SSH Key")} @@ -175,14 +180,14 @@ export default function RootAuthMethods() { { isPasswordFormOpen && } { isSSHKeyFormOpen && } diff --git a/web/src/components/users/RootPasswordPopup.jsx b/web/src/components/users/RootPasswordPopup.jsx index ba0f90b5a1..c5b3417980 100644 --- a/web/src/components/users/RootPasswordPopup.jsx +++ b/web/src/components/users/RootPasswordPopup.jsx @@ -23,6 +23,7 @@ import React, { useState } from "react"; import { Form } from "@patternfly/react-core"; import { PasswordAndConfirmationInput, Popup } from '~/components/core'; +import { _ } from "~/i18n"; import { useInstallerClient } from "~/context/installer"; /** @@ -38,7 +39,7 @@ import { useInstallerClient } from "~/context/installer"; * @param {function} props.onClose - the function to be called when the dialog is closed */ export default function RootPasswordPopup({ - title = "Root password", + title = _("Root password"), isOpen, onClose }) { diff --git a/web/src/components/users/RootSSHKeyPopup.jsx b/web/src/components/users/RootSSHKeyPopup.jsx index bf34c59eb9..17e2ca65af 100644 --- a/web/src/components/users/RootSSHKeyPopup.jsx +++ b/web/src/components/users/RootSSHKeyPopup.jsx @@ -21,6 +21,8 @@ import React, { useState } from "react"; import { Form, FormGroup, FileUpload } from "@patternfly/react-core"; + +import { _ } from "~/i18n"; import { Popup } from '~/components/core'; import { useInstallerClient } from "~/context/installer"; @@ -38,7 +40,7 @@ import { useInstallerClient } from "~/context/installer"; * @param {function} props.onClose - the function to be called when the dialog is closed */ export default function RootSSHKeyPopup({ - title = "Set root SSH public key", + title = _("Set root SSH public key"), currentKey = "", isOpen, onClose @@ -66,13 +68,16 @@ export default function RootSSHKeyPopup({ return ( - + -
+ +
-
+