Skip to content

fix: localize Modal Fields settings tab and field manager - #2408

Merged
callumalpass merged 3 commits into
callumalpass:mainfrom
WangJingJun-dev:fix/modal-fields-i18n
Oct 18, 2026
Merged

callumalpass merged 3 commits into
callumalpass:mainfrom
WangJingJun-dev:fix/modal-fields-i18n

Conversation

@WangJingJun-dev

@WangJingJun-dev WangJingJun-dev commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The Modal Fields settings tab and its field manager rendered hardcoded English strings regardless of the UI language. Every other settings tab routes its text through plugin.i18n.translate, so this tab stood out as untranslated for non-English users (same class of issue as #884).

This PR wires modalFieldsTab.ts and FieldManagerComponent.ts through the translation system with a new settings.modalFields.* key namespace and adds translations for all 8 supported locales.

Out of scope, deliberately: default field/group displayName values (e.g. "Title", "Basic Information") and default status/priority labels are persisted, user-editable data — consistent with how DEFAULT_STATUSES/DEFAULT_PRIORITIES labels are already treated — so they are not localized here.

Changes

  • src/settings/tabs/modalFieldsTab.ts: replace all hardcoded strings (tab heading/description, split-layout and Tab-focus toggles, sync/reset buttons, reset confirmation dialog, notices, init error) with plugin.i18n.translate calls.
  • src/settings/components/FieldManagerComponent.ts: same for the invalid-config error, empty-group state, card row labels ("Enabled:", "Show in Creation:", "Show in Edit:", "Group:"), and the field secondary text (ID: {id} / Key: {key} / "No key set") via interpolation params, matching the existing {count}/{field} convention.
  • src/i18n/resources/{en,de,es,fr,ja,ko,pt,ru,zh}.ts: add the 32 new settings.modalFields.* keys (including the four field-type badge keys added during review) (English source in sentence case per the obsidianmd/ui/sentence-case-locale-module lint rule).
  • i18n.manifest.json / i18n.state.json: regenerated via npm run i18n:sync; npm run i18n:verify reports 0 missing / 0 stale across all locales.
  • tests/unit/settings/modalFieldsTranslations.test.ts: new test asserting key parity, non-empty values, and interpolation-placeholder parity for all locales.
  • tests/unit/issues/issue-1430-modal-fields-property-id-display.test.ts: mock plugin now provides i18n: createI18nService() (existing test convention) so the real translation path is exercised.
  • docs/releases/unreleased.md: added Fixed entry.

Test plan

  • npm run i18n:verify — all locales 2280/2280 up-to-date, 0 stale.
  • npm run lint:ts — 0 errors, 0 warnings.
  • npx jest tests/unit/settings tests/unit/locales tests/unit/issues/issue-1430-modal-fields-property-id-display.test.ts — 89 passed.
  • Full npx jest --ci run: no new failures versus a clean-tree baseline (18 suites fail on unmodified main in this Windows environment, e.g. timezone-sensitive recurrence tests; identical before and after this change).

Notes for reviewers

  • Translations for de, es, fr, ja, ko, pt, ru were drafted to match the tone of each existing locale file; native-speaker review welcome.
  • English UI text changed slightly for the four previously Title Case strings (e.g. "Task Modal Fields Configuration" → "Task modal fields configuration") to satisfy the enforced sentence-case lint rule.

AI assistance disclosure

This change was generated with AI assistance (Kimi Code agent): investigation, implementation, translations, tests, and PR text. Reviewed and verified locally by the PR author per the commands above.

Maintainer follow-up

  • Resolved the release-note conflict against current main without restoring already released entries, and acknowledged @whysoslow.
  • Localized the four field-type badges while preserving stored type identifiers, CSS classes, and saved field/group names.
  • Made locale key-parity checks recursive and added rendered Chinese UI, interpolation, error/empty-state, and reset-cancellation coverage.
  • Reproduced the untranslated badges in an isolated Obsidian instance before the fix, then rebuilt and verified both native regression tests on Obsidian 1.14.2 against the dedicated test vault.
  • Maintainer validation: full Jest suite passed (746 suites, 4,683 tests; 71 suites/1,013 tests skipped, 4 todo), full lint, typecheck, translation verification (all 2,284 keys current per locale), production build, and bundle-size budget passed.

WangJingJun-dev and others added 3 commits October 18, 2026 17:16
The Modal Fields settings tab (modalFieldsTab.ts) and the field manager
component (FieldManagerComponent.ts) used hardcoded English strings, so
they displayed in English regardless of the selected language. Wire both
through plugin.i18n.translate with new settings.modalFields.* keys and
add translations for all supported locales.

Co-authored-by: AI assistant (Kimi Code)
@callumalpass
callumalpass merged commit 79e4858 into callumalpass:main Oct 18, 2026
@callumalpass

Copy link
Copy Markdown
Owner

Thanks, @whysoslow, for finding and fixing this translation gap, and for including translations and tests! Merged with a few follow-ups: the field-type badges are now localized too, translation-key parity checks cover nested keys, and rendering/native Obsidian regression tests verify translated labels, property keys, and reset cancellation while preserving saved names and identifiers. I also resolved the release-note conflict and added your acknowledgement. Full Jest suite (746 suites, 4,683 tests passed, with existing skips), full lint, typecheck, translation verification, production build, bundle-size budget, and both isolated Obsidian regression tests passed.

callumalpass added a commit that referenced this pull request Oct 24, 2026
Keeps the v5 version and native settings. Main's legacy settings-tab
changes are ported to src/settings/native: Enter saves task (#2404),
the incomplete property-identification warning (#2363), Google
"show all-day as free" (2391cd0), and the modal field ID label (#2408).
Custom property key validation and Microsoft reconnect were already
covered by v5's native settings.

Task List movement takes main's #2381 system, which replaces v5's
setupCardTouchDrag list reorder; Kanban keeps longPressTouchDrag.
Tests and an e2e spec that target the removed legacy tabs are dropped.
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.

2 participants