Skip to content

Commit

Permalink
Merge pull request #719 from openSUSE/add_more_translations
Browse files Browse the repository at this point in the history
Mark more texts for translation
  • Loading branch information
lslezak authored Aug 28, 2023
2 parents 6097959 + a7ce2eb commit dbad5f9
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 10 deletions.
3 changes: 2 additions & 1 deletion web/src/components/questions/GenericQuestion.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import React from "react";
import { Text } from "@patternfly/react-core";
import { Popup } from "~/components/core";
import { QuestionActions } from "~/components/questions";
import { _ } from "~/i18n";

export default function GenericQuestion({ question, answerCallback }) {
const actionCallback = (option) => {
Expand All @@ -31,7 +32,7 @@ export default function GenericQuestion({ question, answerCallback }) {
};

return (
<Popup isOpen aria-label="Question">
<Popup isOpen aria-label={_("Question")}>
<Text>
{ question.text }
</Text>
Expand Down
11 changes: 7 additions & 4 deletions web/src/components/questions/LuksActivationQuestion.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,14 @@ import { Alert, Form, FormGroup, Text, TextInput } from "@patternfly/react-core"
import { Icon } from "~/components/layout";
import { Popup } from "~/components/core";
import { QuestionActions } from "~/components/questions";
import { _ } from "~/i18n";

const renderAlert = (attempt) => {
if (!attempt || attempt === 1) return null;

return (
<Alert variant="warning" isInline isPlain title="Given encryption password didn't work" />
// TRANSLATORS: error message, user entered a wrong password
<Alert variant="warning" isInline isPlain title={_("Given encryption password didn't work")} />
);
};

Expand All @@ -54,16 +56,17 @@ export default function LuksActivationQuestion({ question, answerCallback }) {
return (
<Popup
isOpen
title="Encrypted Device"
aria-label="Question"
title={_("Encrypted Device")}
aria-label={_("Question")}
titleIconVariant={() => <Icon name="lock" size="24" />}
>
{ renderAlert(parseInt(question.data.attempt)) }
<Text>
{ question.text }
</Text>
<Form onSubmit={triggerDefaultAction}>
<FormGroup label="Encryption Password" fieldId="luks-password">
{/* TRANSLATORS: field label */}
<FormGroup label={_("Encryption Password")} fieldId="luks-password">
<TextInput
autoFocus
id="luks-password"
Expand Down
3 changes: 2 additions & 1 deletion web/src/components/software/ChangeProductLink.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import React from "react";
import { Link } from "react-router-dom";
import { useSoftware } from "~/context/software";
import { Icon } from "~/components/layout";
import { _ } from "~/i18n";

export default function ChangeProductLink() {
const { products } = useSoftware();
Expand All @@ -32,7 +33,7 @@ export default function ChangeProductLink() {
return (
<Link to="/products">
<Icon name="edit_square" size="24" />
Change product
{_("Change product")}
</Link>
);
}
11 changes: 7 additions & 4 deletions web/src/components/software/ProductSelectionPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import React, { useEffect, useState } from "react";
import { useNavigate } from "react-router-dom";
import { useInstallerClient } from "~/context/installer";
import { useSoftware } from "~/context/software";
import { _ } from "~/i18n";

import {
Button,
Expand Down Expand Up @@ -64,7 +65,7 @@ function ProductSelectionPage() {
};

if (!products) return (
<Loading text="Loading available products, please wait..." />
<Loading text={_("Loading available products, please wait...")} />
);

const buildOptions = () => {
Expand All @@ -88,16 +89,18 @@ function ProductSelectionPage() {

return (
<>
<Title>Product selection</Title>
{/* TRANSLATORS: page header */}
<Title>{_("Product selection")}</Title>
<PageIcon><Icon name="home_storage" /></PageIcon>
<MainActions>
<Button isLarge variant="primary" form="product-selector" type="submit">
Select
{/* TRANSLATORS: button label */}
{_("Select")}
</Button>
</MainActions>

<Form id="product-selector" onSubmit={accept}>
<FormGroup isStack label={`Choose a product (${products.length} available)`} role="radiogroup">
<FormGroup isStack label={_("Choose a product")} role="radiogroup">
{buildOptions()}
</FormGroup>
</Form>
Expand Down

0 comments on commit dbad5f9

Please sign in to comment.