Skip to content

fix(i18n): reuse translated settings title in pad dialog (#7884)#7886

Closed
JohnMcLear wants to merge 1 commit into
developfrom
fix/7884-settings-missing-translations
Closed

fix(i18n): reuse translated settings title in pad dialog (#7884)#7886
JohnMcLear wants to merge 1 commit into
developfrom
fix/7884-settings-missing-translations

Conversation

@JohnMcLear
Copy link
Copy Markdown
Member

Closes part of #7884.

Problem

In v3.x the pad Settings dialog title renders untranslated on non-English UIs (the "title not translated left" in the issue's German screenshot), even though the gear-button tooltip right above it is translated.

Root cause: PR #7545 introduced a dedicated pad.settings.title l10n key for the dialog <h1>. That value ("Settings") is identical to the long-standing pad.toolbar.settings.title key used by the toolbar gear button. Because pad.settings.title was brand new, TranslateWiki volunteers hadn't translated it for most locales yet — so the dialog title fell back to English while the identical, already-translated toolbar key sat unused.

Fix

Point the dialog <h1> at the existing pad.toolbar.settings.title key and delete the duplicate pad.settings.title from en.json. No new strings to translate — the title is immediately localised in the 111 locales that already carry the toolbar key (including German → "Einstellungen").

I verified there is no regression: every locale that had translated the old pad.settings.title also has pad.toolbar.settings.title translated, so no locale loses its dialog title.

The settingsModalHeading backend regression spec is updated to assert the reused key. It still guards the original intent (a neutral "Settings" title regardless of enablePadWideSettings, never the misleading "Pad-wide Settings" label).

Scope note

The other untranslated labels in the German screenshot (Disable Chat, Dark mode, Enforce settings, Fade inactive author colors, User Settings, and the deletion-token strings) are genuinely new strings from #7545/#7554 and the deletion-token feature — they have no existing translated key to reuse, so they're left to the normal TranslateWiki flow rather than hand-seeded. The dual User-Settings / Pad-wide-Settings panels are intentional (per maintainer note on the issue).

Test

$ NODE_ENV=production npx mocha --import=tsx tests/backend/specs/settingsModalHeading.ts
  ✔ uses pad.toolbar.settings.title with the feature enabled
  ✔ uses pad.toolbar.settings.title with the feature disabled (no misleading "Pad-wide" label)
  2 passing

🤖 Generated with Claude Code

The settings modal <h1> used a dedicated `pad.settings.title` key (added in
#7545) that duplicates the long-standing, already-translated
`pad.toolbar.settings.title` ("Settings"). Because the duplicate was new,
TranslateWiki had not translated it for most locales, so the dialog title
rendered untranslated (e.g. English "Settings" on a German UI) even though
the identical toolbar key is translated in 111 locales.

Point the dialog title at `pad.toolbar.settings.title` and drop the duplicate
`pad.settings.title` key, so the title is localised everywhere with no new
strings to translate. Verified every locale carrying the old dialog-title key
also has the toolbar key, so this is a strict improvement with no regression.

Update the settingsModalHeading regression spec accordingly.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@qodo-code-review
Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@qodo-free-for-open-source-projects
Copy link
Copy Markdown

Review Summary by Qodo

Reuse translated toolbar key for settings dialog title

🐞 Bug fix ✨ Enhancement

Grey Divider

Walkthroughs

Description
• Reuse existing translated pad.toolbar.settings.title key for settings dialog
• Remove duplicate pad.settings.title key from English locale file
• Settings title now localised in 111 locales without new translation strings
• Update regression test to verify correct i18n key usage
Diagram
flowchart LR
  A["Settings Dialog<br/>pad.settings.title"] -->|Replace with| B["Toolbar Settings Key<br/>pad.toolbar.settings.title"]
  B -->|Result| C["Immediate localization<br/>111 locales"]
  D["Remove duplicate<br/>en.json"] -->|Cleanup| C

Loading

Grey Divider

File Changes

1. src/templates/pad.html ✨ Enhancement +1/-1

Update settings dialog to reuse toolbar key

• Changed settings dialog ` element to use pad.toolbar.settings.title` instead of
 pad.settings.title
• Reuses existing translated key for immediate localization across all locales

src/templates/pad.html


2. src/locales/en.json 🐞 Bug fix +0/-1

Remove duplicate settings title translation key

• Removed duplicate pad.settings.title key that was never translated in most locales
• Eliminates redundancy with pad.toolbar.settings.title which already exists

src/locales/en.json


3. src/tests/backend/specs/settingsModalHeading.ts 🧪 Tests +8/-5

Update regression tests for i18n key change

• Updated test descriptions to reference pad.toolbar.settings.title instead of
 pad.settings.title
• Updated test assertions to verify correct i18n key is used in both feature-enabled and
 feature-disabled scenarios
• Enhanced comment documentation explaining the reuse of existing translated key

src/tests/backend/specs/settingsModalHeading.ts


Grey Divider

Qodo Logo

@qodo-free-for-open-source-projects
Copy link
Copy Markdown

qodo-free-for-open-source-projects Bot commented Jun 2, 2026

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Qodo Logo

@JohnMcLear JohnMcLear closed this Jun 2, 2026
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.

1 participant