Skip to content

feat: add German translation and make UI elements translatable - #190

Merged
nesquena-hermes merged 1 commit into
nesquena:masterfrom
DavidSchuchert:feat-german-translation
Apr 10, 2026
Merged

nesquena-hermes merged 1 commit into
nesquena:masterfrom
DavidSchuchert:feat-german-translation

Conversation

@DavidSchuchert

Copy link
Copy Markdown
Contributor

This PR introduces full German language support to the Hermes WebUI and enhances the existing i18n system to support
more UI elements.

Changes

  • Added German Locale: Created a complete de bundle in i18n.js covering all UI strings, settings, and commands.
  • Enhanced Translation System: Updated the applyLocaleToDOM function to support automatic translation of title
    (tooltips) and placeholder attributes using new data-i18n-title and data-i18n-placeholder attributes.
  • UI Internalization: Refactored index.html to remove hardcoded English strings from the sidebar, settings panel, and
    empty state, replacing them with translatable data-i18n elements.
  • German Speech Support: Configured the German locale to use de-DE for voice recognition.

How to test

  1. Open the WebUI.
  2. Go to Settings -> Language.
  3. Select "Deutsch".
  4. Verify that the sidebar tabs, settings descriptions, and empty state suggestions are correctly translated.

@nesquena-hermes

Copy link
Copy Markdown
Collaborator

Thanks for this PR! Solid contribution — German translation is complete and the i18n system improvements are well-designed.

Review summary

German locale (de): Comprehensive coverage — all existing en keys translated plus the new sidebar/settings keys added in this PR. A few specific checks:

  • ✅ All function-valued keys (n_messages, downloading, delete_confirm) correctly ported as arrow functions
  • _speech: 'de-DE' set correctly for German speech recognition
  • ✅ Unicode escapes for and are consistent with the existing locale style

New i18n infrastructure (data-i18n-title, data-i18n-placeholder):

The applyLocaleToDOM() additions are clean. One thing to verify: the approval_btn_once_title key already uses data-i18n-title in the existing codebase (it was added in the approval UI work). Your PR handles that correctly and adds the handler that actually processes it — good catch.

New en locale keys: The PR adds sidebar/tab/empty-state keys to the English locale and wires them up in index.html with data-i18n, data-i18n-title, and data-i18n-placeholder attributes. This extends the translatable surface area, which is the right direction.

One thing to double-check: The "Agent profiles" label in the sidebar uses data-i18n="tab_profiles" in this PR, but tab_profiles translates to "Profile" (German: "Profile") while the English value is "Profiles" (plural). The existing data-label="Profiles" attribute on the nav button is not updated. The data-label attribute drives the tooltip text in some paths — you may want to keep it consistent, or confirm it's not used for display after applyLocaleToDOM() runs.

No blockers

Nothing here prevents merging. The routing logic, locale structure, and HTML changes all look correct. Looking forward to seeing this land.

@nesquena nesquena left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Full Review: PR #190 — German translation + i18n enhancements

Thanks @DavidSchuchert! Comprehensive German locale plus useful i18n system improvements.

Security Audit

Clean. All DOM updates use safe property assignments (textContent, title, placeholder) — not innerHTML. No external resources, no injection vectors. The data-i18n-title and data-i18n-placeholder attributes are processed via the same safe t() function as existing data-i18n.

Code Review

German locale (de): Complete coverage — all existing en keys are translated, plus new sidebar/settings/empty-state keys. Function-valued keys (n_messages, downloading, delete_confirm) are correctly ported with German grammar.

i18n system enhancements: The applyLocaleToDOM additions for data-i18n-title and data-i18n-placeholder follow the exact same pattern as the existing data-i18n textContent handler. Clean, consistent.

HTML changes: All 58 deletions and 58 additions are attribute additions (data-i18n, data-i18n-title, data-i18n-placeholder) with English fallback text preserved inline. No structural changes.

en locale additions: New keys for sidebar tabs, settings descriptions, empty state suggestions. Additive — no existing keys changed.

Tests

506 passed, 0 failed, 41 skipped. No regressions.

Verdict

Approved. Clean, safe, comprehensive. Ready to merge.

nesquena-hermes pushed a commit that referenced this pull request Apr 10, 2026
Three issues fixed in the cherry-pick of DavidSchuchert/PR-190:

1. Clear conversation button used data-i18n='copy' (maps to 'Kopieren'
   in German). Renamed to new key 'clear_conv' → 'Clear'/'Löschen'.

2. topbarMeta used data-i18n='new_conversation' (='New conversation')
   for the text 'Start a new conversation'. Renamed to new key
   'start_conversation' → 'Start a new conversation'/'Neue Unterhaltung starten'.

3. Agent profiles sidebar header used data-i18n='tab_profiles'
   (='Profiles') for the heading 'Agent profiles'. Renamed to new key
   'profiles_header' → 'Agent profiles'/'Agenten-Profile'.

All three new keys added to both 'en' and 'de' locales in i18n.js.
@nesquena-hermes

Copy link
Copy Markdown
Collaborator

Rebased onto current master (post v0.41.0, #189, #191 merged). Great contribution — German is comprehensive and the data-i18n-title / data-i18n-placeholder infrastructure is exactly what was needed.

Three i18n key fixes applied in the rebase:

  1. Clear buttondata-i18n="copy" would render as "Kopieren" in German for the Clear conversation button. Added new key clear_conv → "Clear" / "Löschen".

  2. topbarMetadata-i18n="new_conversation" translates to "New conversation" but the element text is "Start a new conversation". Added new key start_conversation → "Start a new conversation" / "Neue Unterhaltung starten".

  3. Profiles sidebar headerdata-i18n="tab_profiles" translates to "Profiles" (short form) but the element says "Agent profiles". Added new key profiles_header → "Agent profiles" / "Agenten-Profile", so the tooltip on the profiles nav tab stays correct.

All three keys added to both en and de locales. 564 tests passing. Ready to merge.

@nesquena-hermes

Copy link
Copy Markdown
Collaborator

Thank you, @DavidSchuchert!

German translation merged and live! You didn't just translate strings — you exposed elements that weren't wired into the i18n system yet and fixed them in the same PR. That's the right way to do it. You're in the Contributors section — thank you!

JKJameson pushed a commit to JKJameson/hermes-webui that referenced this pull request Apr 25, 2026
…ena#190)

Co-authored-by: David Work <davidwork@MBP-von-David.fritz.box>
SysAdminDoc pushed a commit to SysAdminDoc/hermes-webui that referenced this pull request Jun 26, 2026
…ena#190)

Co-authored-by: David Work <davidwork@MBP-von-David.fritz.box>
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