| @@ -22,9 +22,9 @@ | ||
| 22 | 22 | fontSize: "18px", |
| 23 | 23 | cursor: "pointer", |
| 24 | 24 | lineHeight: 1, |
| 25 | 25 | }) |
| 26 | - .attr("title", "Show password"); | |
| 26 | + .attr("title", wp.i18n.__("Show password", "subscription")); | |
| 27 | 27 | |
| 28 | 28 | // Toggle functionality |
| 29 | 29 | $toggleBtn.on("click", function () { |
| 30 | 30 | isPassword = $input.attr("type") === "password"; |
| @@ -31,9 +31,12 @@ | ||
| 31 | 31 | $input.attr("type", isPassword ? "text" : "password"); |
| 32 | 32 | $toggleBtn |
| 33 | 33 | .removeClass("dashicons-visibility dashicons-hidden") |
| 34 | 34 | .addClass(isPassword ? "dashicons-hidden" : "dashicons-visibility") |
| 35 | - .attr("title", isPassword ? "Hide password" : "Show password"); | |
| 35 | + .attr( | |
| 36 | + "title", | |
| 37 | + isPassword ? wp.i18n.__("Hide password", "subscription") : wp.i18n.__("Show password", "subscription"), | |
| 38 | + ); | |
| 36 | 39 | }); |
| 37 | 40 | |
| 38 | 41 | // Insert button |
| 39 | 42 | $input.after($toggleBtn); |
| @@ -59,9 +62,9 @@ | ||
| 59 | 62 | fontSize: "18px", |
| 60 | 63 | cursor: "pointer", |
| 61 | 64 | lineHeight: 1, |
| 62 | 65 | }) |
| 63 | - .attr("title", "Copy to clipboard"); | |
| 66 | + .attr("title", wp.i18n.__("Copy to clipboard", "subscription")); | |
| 64 | 67 | |
| 65 | 68 | // Copy functionality |
| 66 | 69 | $copyBtn.on("click", function (event) { |
| 67 | 70 | event.preventDefault(); |
| @@ -77,11 +80,11 @@ | ||
| 77 | 80 | tempInput.select(); |
| 78 | 81 | document.execCommand("copy"); |
| 79 | 82 | document.body.removeChild(tempInput); |
| 80 | 83 | } |
| 81 | - alert("Data successfully copied to clipboard."); | |
| 84 | + alert(wp.i18n.__("Copied to clipboard.", "subscription")); | |
| 82 | 85 | } catch (err) { |
| 83 | - alert("Failed to the data. Please try to copy manually."); | |
| 86 | + alert(wp.i18n.__("Could not copy. Please copy it manually.", "subscription")); | |
| 84 | 87 | console.error("Failed to the data. ", err); |
| 85 | 88 | } |
| 86 | 89 | }); |
| 87 | 90 | |