Skip to content

Add German translation with key and placeholder checks - #104

Open
nawaaaaaAaar wants to merge 2 commits into
dvejsada:masterfrom
nawaaaaaAaar:add-german-translation
Open

nawaaaaaAaar wants to merge 2 commits into
dvejsada:masterfrom
nawaaaaaAaar:add-german-translation

Conversation

@nawaaaaaAaar

Copy link
Copy Markdown

Summary

Closes #97. Add the requested German translation for Knuspr.de and Gurkerl.at users, covering setup, reauthentication, options, selectors, entity names and states. Add offline checks for the complete string-key tree and exact interpolation placeholders.

Verification

  • python -m unittest discover -s tests -p test_translations.py -v: two tests passed on Python 3.12 and 3.13, with per-string subtests.
  • UTF-8 JSON parses successfully; every English leaf key exists, values are nonempty strings and {email} placeholders remain unchanged.
  • No production Python or API behavior changed.

Limits

AI-assisted translation prepared through Perplexity Computer. Native-speaker and live Home Assistant UI review remain valuable; they have not been performed. The Home Assistant integration suite, hassfest and HACS checks are not claimed as local passes. No customer account or credentials were used.

Copilot AI balanced review requested due to automatic review settings October 5, 2026 09:12

This comment was marked as off-topic.

@dvejsada

dvejsada commented Oct 5, 2026

Copy link
Copy Markdown
Owner

@claude review

@claude

claude Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Claude finished @dvejsada's task in 22s —— View job


Review of PR #104: German translation

  • Read de.json and compare it with en.json
  • Read tests/test_translations.py
  • Run the tests. I couldn't: the shell here blocked python -m unittest pending approval.

Verdict: looks good to merge, with a few optional nits. I found no blocking issues.

Translation (de.json)

  • Structure: reading both files side by side, de.json has the same key tree as en.json. That covers config steps, errors, aborts, options, selectors, binary sensors, sensors, todo and calendar.
  • Placeholders: {email} is intact in reauth_confirm and reconfigure.
  • Tone: it uses the informal "du" consistently, which suits Home Assistant.
  • Wording: the terms read naturally. Examples are "Mehrwegtaschen", "Lieferzeitfenster", "Nicht mehr angebotene Produkte" and "Stk." for pcs.
  • Nit, formatting: de.json writes short objects inline, such as "state": {"on": "Ja", "off": "Nein"} and {"name": "..."}. en.json and (I assume) cs.json use expanded multi-line objects. This is valid JSON, but expanding it would match the other files and keep future diffs consistent.
  • Nit, config.step.user.title: "Rohlík-Konto" is right for CZ. German users with Knuspr.de or Gurkerl.at may find "Shop-Konto" less confusing. This mirrors the English "Rohlík account", so it's optional.
  • Nit, bags_amount: the name "Anzahl der Taschen" is fine. The English name is "Bags Amount", so "Taschen" alone would also work.
  • A native-speaker pass is still worth doing, as the PR description says.

Tests (tests/test_translations.py)

  • The two tests are sound. They check that the key sets match, that values are non-empty strings, and that placeholders are identical.
  • Nit, failure messages: assertEqual(english.keys(), german.keys()) reports only that the key views differ. Asserting on the set difference would name the missing or extra keys:
    self.assertEqual(set(english) - set(german), set(), "missing in de")
    self.assertEqual(set(german) - set(english), set(), "extra in de")
  • Nit, naming: TestGermanTranslation only covers de, but the logic is generic. Parametrising over every translations/*.json (including cs.json) with subTest would cover all locales for little extra code. The file-loading code is also duplicated between the two tests and could move into setUpClass.
  • CI: I didn't check whether any workflow runs tests/. If none does, this check only protects contributors who run it locally.

@dvejsada dvejsada added the enhancement New feature or request label Oct 5, 2026
@nawaaaaaAaar

Copy link
Copy Markdown
Author

Addressed the formatting and failure-message nits: de.json now uses the same expanded two-space style as en.json, and parity failures name missing/extra keys. Both offline tests were rerun successfully on Python 3.12 and 3.13. Translation wording is unchanged; native-speaker and live UI review remain explicitly unperformed. The existing Tests workflow does include tests/ once its run is approved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add German translation (de) for Knuspr.de and Gurkerl.at

3 participants