Skip to content

feat(i18n): add Polish localization - #6111

Merged
Jocs merged 2 commits into
marktext:developfrom
cyryllo:feat/polish-localization
Nov 23, 2026
Merged

Jocs merged 2 commits into
marktext:developfrom
cyryllo:feat/polish-localization

Conversation

@cyryllo

@cyryllo cyryllo commented Nov 21, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds Polish (pl) as a UI language, following the same structure as the Italian localization (#5538):

  • packages/desktop/static/locales/pl.json: full desktop UI translation, with the same keys as en.json.
  • packages/muya/src/locales/pl.ts: editor engine strings (quick insert, format toolbar, table tools, emoji picker, image tools, diagrams). Exported from @muyajs/core.
  • Registered pl in SUPPORTED_LANGUAGES (common/i18n.ts), the Preferences language list, MUYA_LOCALES and electronLanguages in electron-builder.yml.
  • Added the preferences.general.language.polish label ("Polski") to every locale file, as was done for italian.
  • Polish keeps product names (Front Matter, Mermaid, PlantUML) in English, so pl is added to TERM_PRESERVING_LOCALES in both locale validation specs.

Type of change

  • Bug fix (non-breaking, fixes an issue)
  • New feature (non-breaking, adds functionality)
  • Breaking change (causes existing functionality to change)
  • Documentation update

Test plan

  • New tests added: i18n.spec.ts now expects pl and pl-PL to resolve to pl. The "unsupported language" example changed from pl-PL to sv-SE. localeCompleteness.spec.ts covers the new muya locale.
  • pnpm run lint (0 errors), pnpm run typecheck and pnpm --filter @muyajs/core lint:types pass.
  • Locale specs pass: locale-validation.spec.ts + i18n.spec.ts (87 tests) and muya localeCompleteness.spec.ts (79 tests).
  • Manually tested on: Linux

Full unit runs: desktop 1752 passed / 2 failed, muya 5022 passed / 1 failed. The failures are pandoc-discovery.spec.ts (2) and fancyLists.spec.ts > pandoc reads the same structure (1). They fail the same way on a clean develop checkout on a machine with Pandoc installed at /usr/bin/pandoc, so they are environment-specific and unrelated to this change.

Notes for reviewers [optional]

  • The translation was prepared with AI assistance.
  • Polish typographic quotes („…”) are used in user-facing messages. Menu accelerator & is kept in menu.theme.theme ("&Motyw").
  • Imperative mood is used for actions ("Zapisz", "Otwórz plik"), matching common Polish desktop conventions.
  • The Muya playground and e2e host language selects were not changed. They list only a subset of locales (no it, nl, ru or tr either).

By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.

Add a Polish translation for the desktop UI (static/locales/pl.json) and
the muya editor engine (src/locales/pl.ts), and register `pl` as a
supported interface language so it is selectable in Preferences and
auto-detected from a pl-* system locale.

Polish keeps product names (Front Matter, Mermaid, PlantUML) in English,
so it joins TERM_PRESERVING_LOCALES in both locale validation specs.
@Tkaixiang
Tkaixiang requested review from Tkaixiang and a balanced review from Copilot November 23, 2026 07:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The AI-assisted Polish translation needs native-speaker review and in-app wording and layout validation, since no manual UI testing was reported and structural locale tests cannot establish linguistic quality or rendering fit.

No open issues 🎉

What changed in this PR

Adds Polish as MarkText’s 14th UI language across the desktop application and Muya editor engine, following the existing localization structure.

Changes:

  • Adds Polish desktop and editor translations, with “Polski” available in every locale’s language list.
  • Registers Polish for language detection, preferences, Muya exports, and packaged Electron resources.
  • Extends locale validation and language-matching tests, and updates Muya’s documentation.
File Description
packages/​muya/​src/​locales/​pl.ts Adds Polish editor translations.
packages/​muya/​src/​locales/​index.ts Exports the Polish locale.
packages/​muya/​src/​index.ts Exposes Polish through the public package API.
packages/​muya/​src/​__tests__/​localeCompleteness.spec.ts Includes Polish in locale completeness checks.
packages/​muya/​README.md Documents 14 supported locales, including Polish.
packages/​desktop/​test/​unit/​specs/​locale-validation.spec.ts Allows preserved technical names in Polish.
packages/​desktop/​test/​unit/​specs/​i18n.spec.ts Tests pl and pl-PL language matching.
packages/​desktop/​static/​locales/​zh-TW.json Adds the “Polski” language label.
packages/​desktop/​static/​locales/​zh-CN.json Adds the “Polski” language label.
packages/​desktop/​static/​locales/​tr.json Adds the “Polski” language label.
packages/​desktop/​static/​locales/​ru.json Adds the “Polski” language label.
packages/​desktop/​static/​locales/​pt.json Adds the “Polski” language label.
packages/​desktop/​static/​locales/​pl.json Adds Polish desktop UI translations.
packages/​desktop/​static/​locales/​nl.json Adds the “Polski” language label.
packages/​desktop/​static/​locales/​ko.json Adds the “Polski” language label.
packages/​desktop/​static/​locales/​ja.json Adds the “Polski” language label.
packages/​desktop/​static/​locales/​it.json Adds the “Polski” language label.
packages/​desktop/​static/​locales/​fr.json Adds the “Polski” language label.
packages/​desktop/​static/​locales/​es.json Adds the “Polski” language label.
packages/​desktop/​static/​locales/​en.json Adds the “Polski” language label.
packages/​desktop/​static/​locales/​de.json Adds the “Polski” language label.
packages/​desktop/​src/​renderer/​src/​util/​muyaLocale.ts Maps the Polish preference to Muya’s locale.
packages/​desktop/​src/​renderer/​src/​prefComponents/​general/​config.ts Adds Polish to the language selector.
packages/​desktop/​src/​common/​i18n.ts Registers Polish as a supported language.
packages/​desktop/​electron-builder.yml Includes Polish Electron language resources.

Review effort: Balanced

@Jocs
Jocs merged commit 14037d0 into marktext:develop Nov 23, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants