fix translation title: add original title + translated into language to new window
This commit is contained in:
parent
5477c2d6a5
commit
2587fcf050
2 changed files with 2 additions and 4 deletions
|
|
@ -65,9 +65,7 @@ export function openTranslateModal() {
|
|||
pageTabLink.setAttribute("aria-selected", "true");
|
||||
pageTabLink.setAttribute("aria-controls", "page-panel");
|
||||
pageTabLink.href = "#page-panel";
|
||||
// Include original page title in tab text
|
||||
const originalTitle = document.title || 'Page';
|
||||
pageTabLink.textContent = `${getUIText("translatePageTab")}: ${originalTitle}`;
|
||||
pageTabLink.textContent = getUIText("translatePageTab");
|
||||
pageTabLink.setAttribute("data-i18n", "translatePageTab");
|
||||
pageTabItem.appendChild(pageTabLink);
|
||||
|
||||
|
|
|
|||
|
|
@ -339,7 +339,7 @@ export async function handleSmartTranslate(button) {
|
|||
const newWindow = window.open("", "_blank");
|
||||
newWindow.document.write(translatedHtml);
|
||||
newWindow.document.close();
|
||||
newWindow.document.title = `${document.title} (${name})`;
|
||||
newWindow.document.title = `${document.title} - translated into ${nativeName}`;
|
||||
|
||||
// Close dropdown
|
||||
dropdown.remove();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue