diff --git a/src/elements/CopyableInputBox.js b/src/elements/CopyableInputBox.js index b19b175..b78c45a 100644 --- a/src/elements/CopyableInputBox.js +++ b/src/elements/CopyableInputBox.js @@ -1,13 +1,22 @@ import ClipboardJS from "clipboard"; import { addClipboardNotifications } from "../pageUtils.js"; -import { makeFormIcon, makeElement } from "../htmlUtils.js"; +import { makeElement } from "../htmlUtils.js"; import { MarginInline } from "./MarginInline.js"; +import i18next from "i18next"; export function CopyableInputBox(text, copyable = true) { let inputBoxDiv = makeElement({ tag: "div" }); let inputBoxCopyButton = null; if (copyable) { - inputBoxCopyButton = makeFormIcon("copy"); + inputBoxCopyButton = makeElement({ + tag: "a", + class: "uk-form-icon", + attributes: { + "uk-icon": "icon: copy", + "role": "img", + "aria-label": i18next.t("copy_input_box_copy_icon_text") + } + }); let clipboard = new ClipboardJS(inputBoxCopyButton); addClipboardNotifications(clipboard, 600); } diff --git a/src/htmlUtils.js b/src/htmlUtils.js index ae2de21..1937f69 100644 --- a/src/htmlUtils.js +++ b/src/htmlUtils.js @@ -33,8 +33,4 @@ export function setElementAttributes(element, attributes) { for (let key of Object.getOwnPropertyNames(attributes)) { element.setAttribute(key, attributes[key]); } -} - -export function makeFormIcon(icon) { - return makeElement({ tag: "a", class: "uk-form-icon", attributes: { "uk-icon": `icon: ${icon}` } }); } \ No newline at end of file diff --git a/src/translations/en.js b/src/translations/en.js index 66f4aa2..b5cd539 100644 --- a/src/translations/en.js +++ b/src/translations/en.js @@ -16,6 +16,8 @@ module.exports = { "copy_modal_copy_btn": "Copy", "copy_modal_close_btn": "Close", + // Copyable Input Box + "copy_input_box_copy_icon_text": "Copy Button", // Me Page "me_page_title": "Me/Settings",