Skip to content

Commit

Permalink
[Upd #323] Add intl to wizard tooltip
Browse files Browse the repository at this point in the history
  • Loading branch information
LaChope committed Apr 19, 2024
1 parent 220e9c0 commit f4fd276
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src/components/wizard/HorizontalWizardNav.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ import { ConfigurationContext } from "../../contexts/ConfigurationContext";
import Question from "../Question";
import classNames from "classnames";
import IconOverlay from "../IconOverlay.jsx";
import { useIntl } from "react-intl";

const HorizontalWizardNav = ({ steps, onNavigate, currentStep }) => {
const { options } = useContext(ConfigurationContext);
const intl = useIntl();

return (
<Card.Header>
Expand All @@ -21,7 +23,7 @@ const HorizontalWizardNav = ({ steps, onNavigate, currentStep }) => {
{steps.map((step, index) => (
<IconOverlay
id="step-disabled"
tooltipContent="Navigation to this tab is disabled to prevent overlooking important questions. Use form-related buttons to navigate to this tab instead."
tooltipContent={intl.formatMessage({ id: "wizard.nav.tooltip" })}
show={!options.enableWizardStepSkip}
>
<NavItem key={"nav" + index} id={"wizard-nav-" + index}>
Expand Down
4 changes: 3 additions & 1 deletion src/components/wizard/VerticalWizardNav.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,19 @@ import FormUtils from "../../util/FormUtils";
import Question from "../Question";
import classNames from "classnames";
import IconOverlay from "../IconOverlay.jsx";
import { useIntl } from "react-intl";

const VerticalWizardNav = ({ steps, onNavigate, currentStep }) => {
const { options } = useContext(ConfigurationContext);
const intl = useIntl();

return (
<div className="wizard-nav col-2 p-0">
<ListGroup>
{steps.map((step, index) => (
<IconOverlay
id="step-disabled"
tooltipContent="Navigation to this tab is disabled to prevent overlooking important questions. Use form-related buttons to navigate to this tab instead."
tooltipContent={intl.formatMessage({ id: "wizard.nav.tooltip" })}
show={!options.enableWizardStepSkip}
>
<ListGroupItem
Expand Down
3 changes: 2 additions & 1 deletion src/i18n/cs.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"comment.form.placeholder": "Sem napište své komentáře (Ctrl+Enter pro potvrzení)"
"comment.form.placeholder": "Sem napište své komentáře (Ctrl+Enter pro potvrzení)",
"wizard.nav.tooltip": "Navigace na této kartě je zakázána, aby nedošlo k přehlédnutí důležitých otázek. K navigaci na tuto kartu použijte tlačítka související s formulářem."
}
3 changes: 2 additions & 1 deletion src/i18n/en.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"comment.form.placeholder": "Write your comments here (Ctrl+Enter to confirm, Esc to cancel)"
"comment.form.placeholder": "Write your comments here (Ctrl+Enter to confirm, Esc to cancel)",
"wizard.nav.tooltip": "Navigation to this tab is disabled to prevent overlooking important questions. Use form-related buttons to navigate to this tab instead."
}

0 comments on commit f4fd276

Please sign in to comment.