i18n: Localize hardware accelerartion information

This commit is contained in:
Daniel Jacobs 2023-10-02 10:24:00 -04:00 committed by Aaron Hill
parent 0158511a8e
commit 1d3728e7ed
2 changed files with 15 additions and 9 deletions

View File

@ -1,3 +1,5 @@
import { text } from "./i18n";
/**
* Insert all rules from array in the style sheet.
*
@ -406,6 +408,15 @@ export function applyStaticStyles(styleElement: HTMLStyleElement) {
text-align: right;
width: 28px;
}`,
`.acceleration-link {
color: var(--ruffle-blue);
text-decoration: none;
}`,
`.acceleration-link:hover {
text-decoration: underline;
}`,
];
insertRules(styleElement.sheet, rules);
}
@ -791,16 +802,12 @@ const hardwareModal = createElement(
const hardwareModalArea = createElement("div", undefined, "modal-area");
const hardwareModalClose = createElement("span", undefined, "close-modal");
hardwareModalClose.textContent = "\u00D7";
const hardwareModalSpanOne = createElement("span");
hardwareModalSpanOne.textContent =
"It looks like hardware acceleration is not enabled. While Ruffle may work, it could be unreasonably slow. You can enable hardware acceleration by ";
const hardwareModalLink = document.createElement("a");
hardwareModalLink.href =
"https://github.com/ruffle-rs/ruffle/wiki/Frequently-Asked-Questions-For-Users#chrome-hardware-acceleration";
hardwareModalLink.target = "_blank";
hardwareModalLink.textContent = "following these steps";
const hardwareModalSpanTwo = createElement("span");
hardwareModalSpanTwo.textContent = ".";
hardwareModalLink.className = "acceleration-link";
hardwareModalLink.textContent = text("enable-hardware-acceleration");
// Context menu overlay elements
const contextMenuOverlay = createElement(
@ -874,9 +881,7 @@ appendElement(videoModalArea, videoHolder);
appendElement(ruffleShadowTemplate.content, hardwareModal);
appendElement(hardwareModal, hardwareModalArea);
appendElement(hardwareModalArea, hardwareModalClose);
appendElement(hardwareModalArea, hardwareModalSpanOne);
appendElement(hardwareModalArea, hardwareModalLink);
appendElement(hardwareModalArea, hardwareModalSpanTwo);
// Context menu overlay append
appendElement(ruffleShadowTemplate.content, contextMenuOverlay);
appendElement(contextMenuOverlay, contextMenu);

View File

@ -10,6 +10,7 @@ update-ruffle = Update Ruffle
ruffle-demo = Web Demo
ruffle-desktop = Desktop Application
ruffle-wiki = View Ruffle Wiki
enable-hardware-acceleration = It looks like hardware acceleration is not enabled. While Ruffle may work, it could be unreasonably slow. You can find out how to enable hardware acceleration by following this link.
view-error-details = View Error Details
open-in-new-tab = Open in a new tab
click-to-unmute = Click to unmute
@ -68,4 +69,4 @@ error-unknown =
{$outdated ->
[true] If you are the server administrator, please try to upload a more recent version of Ruffle (current build is outdated: {$buildDate}).
*[false] This isn't supposed to happen, so we'd really appreciate if you could file a bug!
}
}