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

RichText Toolbar translations #1261

Merged
merged 3 commits into from Nov 14, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions components/form-builder/lexical-editor/Toolbar.tsx
Expand Up @@ -10,6 +10,7 @@ import { Link } from "@styled-icons/material/Link";
import { FormatListBulleted } from "@styled-icons/material/FormatListBulleted";
import { FormatListNumbered } from "@styled-icons/material/FormatListNumbered";
import { TOGGLE_LINK_COMMAND } from "@lexical/link";
import { useTranslation } from "next-i18next";

import {
$isListNode,
Expand All @@ -30,7 +31,6 @@ import {
import { $wrapNodes } from "@lexical/selection";
import styled from "styled-components";
import { sanitizeUrl } from "./utils/sanitizeUrl";
import { t } from "i18next";

const blockTypeToBlockName = {
bullet: "Bulleted List",
Expand Down Expand Up @@ -235,12 +235,13 @@ export const Toolbar = ({ editorId }: { editorId: string }) => {
);
}, [editor, updateToolbar]);

// @TODO: aria-controls below needs an id for the editor
const { t } = useTranslation("form-builder");

return (
<>
<ToolbarContainer
role="toolbar"
aria-label="Text formatting"
aria-label={t("textFormatting")}
aria-controls={editorId}
onKeyDown={handleNav}
>
Expand Down Expand Up @@ -354,7 +355,6 @@ export const Toolbar = ({ editorId }: { editorId: string }) => {
onClick={insertLink}
className={"toolbar-item " + (isLink ? "active" : "")}
aria-label={t("insertLink")}
title={t("insertLink")}
>
<Link size={20} />
</button>
Expand Down
1 change: 1 addition & 0 deletions public/static/locales/en/form-builder.json
Expand Up @@ -139,6 +139,7 @@
"switch": "Switch",
"testDataDelivery": "Test data delivery",
"testYourResponseDelivery": "Test your response delivery",
"textFormatting": "Text formatting",
"thereWasAnErrorPublishing": "There was an error publishing the form",
"title": "Title",
"toTestInstructions": "To test to see how you will gather form responses, please complete the following steps:",
Expand Down
1 change: 1 addition & 0 deletions public/static/locales/fr/form-builder.json
Expand Up @@ -139,6 +139,7 @@
"switch": "[FR] Switch",
"testDataDelivery": "[FR] Test data delivery",
"testYourResponseDelivery": "[FR] Test your response delivery",
"textFormatting": "[FR] Text formatting",
"thereWasAnErrorPublishing": "[FR] There was an error publishing the form",
"title": "[FR] Title",
"toTestInstructions": "[FR] To test to see how you will gather form responses, please complete the following steps:",
Expand Down