Markdown Viewer v3.9.0 has a client-side translation dictionary in script.js. It changes visible UI labels, toolbar text, modal titles, stats labels, and common messages without sending text to a translation service.
| Code | Language |
|---|---|
en |
English |
zh |
Simplified Chinese |
ja |
Japanese |
ko |
Korean |
pt |
Portuguese (Brazil) |
es |
Spanish |
fr |
French |
de |
German |
ru |
Russian |
it |
Italian |
tr |
Turkish |
pl |
Polish |
tw |
Traditional Chinese |
uk |
Ukrainian |
The app chooses a language in this order:
- URL query parameter, such as
?lang=pt. - Hash query parameter when present in a shared URL.
- Saved
localStoragekeyapp-lang. - Browser language from
navigator.language. - English fallback.
When a user picks a language from the dropdown, the app saves app-lang and updates the URL query parameter.
The dictionary covers:
- Main toolbar labels.
- Import/export labels.
- Share Snapshot and Live Share labels.
- View mode labels.
- Stats labels.
- Theme labels.
- Modal titles for help, about, share, rename, link, reference, image, table, and find/replace.
- Loading messages for emoji lookup and GitHub file loading.
- Placeholder text.
Some strings remain English because they come from dynamic renderer output, browser APIs, third-party libraries, generated filenames, external services, or low-level error messages.
Translations are stored in I18N_DICTS:
{
title: "Markdown Viewer",
import: "Import",
export: "Export",
exportMd: "Markdown (.md)",
exportHtml: "HTML",
exportPdf: "PDF",
exportPng: "Image (.png)",
copy: "Copy",
shareSnapshot: "Share Snapshot",
liveShare: "Live Share",
reset: "Reset",
editor: "Editor",
split: "Split",
preview: "Preview",
minRead: "Min Read",
words: "Words",
chars: "Chars",
darkMode: "Dark Mode",
lightMode: "Light Mode",
findReplace: "Find & Replace"
}Add new keys to every locale when introducing new visible UI text. If a key is missing, code should fall back to English or a hard-coded safe label.
- Update
I18N_DICTSfor all supported locales. - Update desktop resources by running the desktop prepare step.
- Check desktop and mobile menus.
- Check modal titles and buttons.
- Check Share Snapshot and Live Share labels.
- Check
?lang=URLs. - Keep language names readable in both desktop and mobile dropdowns.
Localization is local. The app does not send document text or UI text to machine translation APIs.