show both English and native language names in translation dropdown
This commit is contained in:
parent
7851c5747c
commit
e87e27b2a2
1 changed files with 4 additions and 2 deletions
|
|
@ -2,7 +2,7 @@
|
|||
import { initializeChunkFiveFont } from "./ui-themes.js";
|
||||
import { getUIText } from "./ui-translations.js";
|
||||
import { extractWebpageContent } from "./content.js";
|
||||
import { translateCurrentPage, translateText, translateHTML, SUPPORTED_LANGUAGES } from "./translation.js";
|
||||
import { translateCurrentPage, translateText, translateHTML, SUPPORTED_LANGUAGES, NATIVE_LANGUAGE_NAMES } from "./translation.js";
|
||||
|
||||
// Function to fetch full HTML content from a remote URL using CORS proxy
|
||||
async function fetchRemotePageHTML(url) {
|
||||
|
|
@ -219,7 +219,9 @@ export function openTranslateModal() {
|
|||
Object.entries(SUPPORTED_LANGUAGES).forEach(([code, name]) => {
|
||||
const option = document.createElement("option");
|
||||
option.value = code;
|
||||
option.textContent = name;
|
||||
const nativeName = NATIVE_LANGUAGE_NAMES[code];
|
||||
// Show both English and native names, unless they're the same
|
||||
option.textContent = nativeName && nativeName !== name ? `${name} - ${nativeName}` : name;
|
||||
languageSelect.appendChild(option);
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue