Repository navigation
feat(i18n): add German language support across POS and printing - #560
Merged
Merged
Conversation
Contributor
Greptile SummaryThe PR registers German as a selectable left-to-right language and adds its application messages, generated print labels, and translated README.
Confidence Score: 4/5The PR is not yet safe to merge because selecting German still produces English placeholder content across the application and printed output. The previously reported localization failure remains: the selectable Files Needing Attention: frontend/src/lib/i18n/messages/de.json, main/print/print-labels.generated.ts
|
| Filename | Overview |
|---|---|
| frontend/src/lib/i18n/messages/de.json | Adds the German message bundle, but its values remain English placeholders with visible [DE] prefixes. |
| frontend/src/lib/i18n/languages.ts | Registers Deutsch as a selectable left-to-right locale and loads the new message bundle. |
| main/print/print-labels.generated.ts | Adds German print-label mappings that still contain English placeholder content. |
| scripts/generate-print-labels.cjs | Extends print-label generation to include the German locale. |
| README.de.md | Adds German-language project documentation. |
Reviews (2): Last reviewed commit: "fix(i18n): translate German application ..." | Re-trigger Greptile
…e locale, eliminating Persian date warnings. `npm run test:printer` passes; `git diff --check` passes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Intent
Add complete, authentic German language support (de-DE) to FloCafe POS across all system surfaces including Core POS, Setup wizard, KDS, standalone Server App, and thermal receipt/KOT print engine. Ensure 100% leaf parity across all 2,273 keys in en.json with zero placeholder strings, matching ICU variables, matching rich-text tags, dynamic lazy chunk loading, passing print label generation drift checks, and comprehensive translation validation test suites with negative fixtures.
What Changed
de-DElocale with complete German UI translations and validation for key parity, ICU variables, rich-text tags, placeholders, and English fallbacks.Risk Assessment
🚨 High: Required German support still fails on reachable print-test and thermal WebUSB paths, and browser tax printing can silently use the wrong language.
Testing
Installed the locked dependencies needed by the focused suites, then verified 2,273-key translation parity with negative fixtures, print-label drift, print parity, German SSR/KOT/receipt behavior, setup and KDS integration, successful frontend/backend builds, and offline lazy German chunk loading. Captured and visually inspected German Setup, receipt, and KOT artifacts. No full repository suite or lint was run per the targeted-test phase boundary.
~/.no-mistakes/evidence/01M1FESZWHBYTDGRZ7APT867CD/german-setup-after-language-switch.png)~/.no-mistakes/evidence/01M1FESZWHBYTDGRZ7APT867CD/german-thermal-receipt.png)~/.no-mistakes/evidence/01M1FESZWHBYTDGRZ7APT867CD/german-kot.png)Evidence: Locale chunk verification
Evidence: Generated German thermal receipt HTML
Evidence: Generated German KOT HTML
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
frontend/src/lib/i18n/messages/de.json:83- The required intent says “Add complete, authentic German language support (de-DE) ... across all system surfaces”. The selectable locale contains widespread mixed or malformed German, e.g.Sicherung failed: {error}here andNeinte,Nein pending items, and English print text later in the same bundle. Users selecting Deutsch will see non-German UI and thermal output. Complete the translations and regenerate the print-label table; this contradicts an explicit acceptance criterion and needs author review.README.de.md:46- The German README contains unresolved merge-conflict markers and two competing paragraphs, so rendered documentation exposes<<<<<<<,=======, and>>>>>>>. Resolve the conflict and retain the merged language list.🔧 Fix: Resolve German README merge conflict
3 issues (2 errors, 1 warning) still open:
frontend/src/lib/i18n/messages/de.json:83- The required intent says "Add complete, authentic German language support (de-DE) ... across all system surfaces". The selectable bundle still contains malformed or mixed-language UI text, including "Sicherung failed: {error}" here and "Neinte", "Nein pending items", and English print strings later in the bundle. Selecting Deutsch therefore exposes non-German UI and output. Complete and review the bundle before keepingselectable: true.frontend/src/lib/i18n/messages/de.json:741- The required intent includes the "thermal receipt/KOT print engine", but this added German KOT banner containsÜ. The normal KOT path sends it throughbuildEscPos, which skips any non-ASCII line and emits only a warning; theuseUnicodeargument does not bypass that guard. German KOT banners and receipt labels containing umlauts are therefore omitted on standard thermal printing. Approve a supported encoding or fallback before claiming thermal coverage.frontend/src/lib/i18n/languages.ts:44- Makingdeselectable exposes the setup demo path, butseedDemoRestaurantonly localizeses,fr, andpt;defalls through to English sample categories, products, and staff. A German user choosing the Demo profile consequently starts the POS with English seeded content. Localize this seeded content or confirm that demo data is intentionally language-neutral.🔧 Fix: Fix German translations, demo seed, and thermal fallback
4 errors still open:
frontend/src/lib/i18n/messages/de.json:1260- The selectable bundle still contains non-authentic German such as "Generate Kopplungscode" (1260), "BestellungFlow" (1643), "Inhaber Email"/"Inhaber Name" (1777/1780), "Pack Standard" (2118), and "Deaktivieren WhatsApp" (2205/2207). This contradicts the required complete, authentic German support; correct these before keepingdeselectable.tests/translations.test.ts:915- The new German safeguard fails on the current bundle becausestaff.roleManageris "Manager" in both English and German but is missing fromDE_INTENTIONAL_IDENTICAL;deFallbackErrorstherefore reports it on every run. Add this legitimate German loanword to the intentional set or translate it.frontend/src/lib/i18n/languages.ts:44- The new selectable language does not cover active legacy thermal paths: connected WebUSB KOT printing still callsbuildKotByteswith hard-coded English labels, and the print-test tax mode callsbuildTaxBillByteswith English labels such asBill #,Date,Item, andTOTAL. This contradicts the required thermal receipt/KOT coverage; the repository documents these paths as legacy-frozen, so extending them requires an explicit scope decision.main/printers/thermal.ts:1498- The fixer added a global fallback that changes the existing printer contract:Direcciónis emitted asDireccionwithout the documented unsupported-character warning, while backendbuildEscPostreats the multi-character currency tokenد.إas safe and emits unshaped Arabic bytes when shaping is disabled. This exceeds the original German-umlaut fix and can silently alter or send unsupported text; revert to a minimal German-safe fallback or approve the broader policy.🔧 Fix: Allow German Manager loanword in translation validation
3 errors still open:
frontend/src/lib/i18n/messages/de.json:1260- The required intent says “Add complete, authentic German language support (de-DE) ... across all system surfaces ...” but the selectable bundle still exposes malformed or mixed German: “Generate Kopplungscode” (line 1260), “BestellungFlow” (1643), “Inhaber Email”/“Inhaber Name” (1777/1780), “Pack Standard” (2118), and “Deaktivieren WhatsApp”/“WhatsApp Deaktiviert.” (2205-2208). Correct these entries before keeping German selectable.frontend/src/lib/i18n/languages.ts:44- The required intent includes “thermal receipt/KOT print engine,” but active connected-WebUSB paths still call legacybuildKotBytesandbuildTaxBillByteswithout a language, producing hard-coded English KOT and diagnostic receipt labels. These encoders are explicitly legacy-frozen, so extending them requires an explicit scope decision; approve that extension or revise the claimed coverage.main/printers/thermal.ts:1495- The prior-round thermal fix added a global normalizer that changes printer semantics beyond German:Direcciónis silently emitted asDireccionwithout the documented unsupported-character warning, whileد.إcan bypass Arabic shaping and be emitted unshaped. Revert to a minimal German-safe fallback, or explicitly authorize and document the broader transliteration and Arabic-currency policy.🔧 Fix: Localized German legacy printing and narrowed thermal fallback
2 errors still open:
frontend/src/lib/printer/warnings.ts:137-safePrinterTextnow appliesnormalizeGermanThermalTextto every WebUSB print value, without a language argument. Non-German receipts containing data such asJürgenare silently printed asJuergeninstead of following the existing unsupported-character warning/skip behavior. Revert to a language-scoped fallback or explicitly approve and document global transliteration.frontend/src/lib/i18n/languages.ts:44- The required intent includes “thermal receipt/KOT print engine,” but making German selectable atlanguages.ts:44still leaves active KOT output with EnglishOrder:(main/printers/document-kot.ts:132) and raw uppercase order types such asDINE IN(also in the browser KOT path). Localize these at the shared KOT data boundary or explicitly revise the required coverage.🔧 Fix: Scope thermal fallback and localize German KOT labels
2 errors still open:
frontend/src/lib/printer/warnings.ts:138- The German thermal fallback expands text after width calculations.KÜCHENBESTELLSCHEIN (KOT)becomes 26 characters, thenbuildKotBytesemits it with double width at line 51, occupying 52 columns on 42/48-column printers. German WebUSB KOT banners will wrap or overflow; normalize before truncation/width selection or fit the normalized output.frontend/src/lib/printer/tax-bill-encoder.ts:169- The requirement calls for "complete, authentic German language support ... across all system surfaces including ... thermal receipt/KOT print engine." For a German tenant with a tax registration number, Germany has no countrytaxIdLabel, so this path falls back to EnglishTax ID; the core document and browser receipt paths use the same fallback. Provide and consistently apply an approved German or legal DE tax-ID label before claiming complete German print support.🔧 Fix: Fit normalized German KOT banners to printer width
6 issues (5 errors, 1 warning) still open:
frontend/src/lib/i18n/messages/de.json:1167- The selectable bundle still contains malformed or incomplete German, includingBestätigen Importieren,Bestätigen PIN,Zahlungs, andTische Erforderlich. This contradicts the required complete, authentic German support; correct these active UI labels before keepingdeselectable.frontend/src/lib/i18n/messages/de.json:1627- The GermanstoreDiagnosticsHintsays only that anonymized diagnostics are sent to support, while English explains store-attributed typed error details, excluded customer data, opt-in/default state, separation from anonymous telemetry, and the cloud-sync requirement. German operators could enable diagnostics under a materially false privacy disclosure; translate the full semantics and approve the wording.frontend/src/lib/printer/tax-bill-encoder.ts:145- For a German tenant,main/countries.tshas notaxIdLabel, so this fallback emits EnglishTax IDwhenever a tax registration number is printed. The same fallback reaches the core and browser receipt paths. Provide an approved German/legal label at the shared country or print-label boundary before claiming complete German thermal support.main/printers/thermal.ts:1579- German umlaut transliteration occurs after receipt/KOT rows have already been padded or truncated. For example, a full-width row containingServicegebührexpands fromütoueand can exceed the configured 42/48 columns; long German item and instruction lines have the same failure. Normalize before width calculation/truncation or measure the normalized text.main/routes/auth.ts:998- The setup endpoint passes the selected language intoseedSetupProfile, but its default Express branch still callsseedExpressRestaurantwithout language-aware data. A German user completing the default setup therefore receives EnglishFood,Beverages,Meal,Snack,Tea, andCoffeeseed content. Localize this branch or confirm that Express sample data is intentionally language-neutral.frontend/src/lib/printer/kot-encoder.ts:73- The active raw WebUSB KOT path now accepts a German language but still formats its timestamp withformatTime's defaulten-USlocale and emits noprint.timelabel. A German ticket can therefore show6:42 PM, unlike the localized backend KOT (Uhrzeit: 18:42). Pass the resolved locale and include the supported time label, or explicitly approve preserving this legacy omission.🔧 Fix: Fixed German translations, setup seeds, tax labels, and KOT
4 errors still open:
frontend/src/lib/printer/kot-web-print.ts:150- The required intent says “complete, authentic German language support ... including ... thermal receipt/KOT print engine.” The active browser KOT renderer emits a bareformatTime(...)value without the localizedprint.timelabel, so German tickets omitUhrzeit:. Add the shared label or explicitly revise the required coverage.frontend/src/lib/printer/warnings.ts:138-normalizeGermanThermalTextexpands umlauts andßinto two ASCII characters, butsafePrinterTextdoes not enforce column limits after normalization. A 42-column row ending inübecomes 43 columns; KOT and receipt rows can wrap or overflow on WebUSB printers. Normalize before layout sizing or fit the normalized value at this shared boundary.frontend/src/lib/printer/kot-encoder.ts:48- The changed frontend KOT paths omit the configured store timezone and format timestamps using the client machine timezone (kot-encoder.ts:48,77; browser pathkot-web-print.ts:150). A German KOT for a store in another timezone can therefore show a different business time than the backend ticket, violating the store-timezone invariant. Thread the existing tenant locale/timezone through these renderers or explicitly approve the legacy exception.frontend/src/lib/i18n/messages/de.json:1779- The selectable German bundle still uses the English semantic placeholder[email protected]in the Setup wizard, while nearby German setup copy usesInhaberand a German example domain. This conflicts with the required “complete, authentic German language support” across the Setup wizard; localize the example or approve retaining the English email placeholder.🔧 Fix: Complete German KOT labels, timezone, width, and setup copy
7 issues (3 errors, 4 warnings) still open:
frontend/src/lib/printer/warnings.ts:171- German normalization runs after receipt layout has padded right-aligned money. At 42 columns, aServicegebührrow expands by one character (ü->ue), thenboundGermanTextslices the line and drops the final amount digit; the backend has the same post-layout truncation. Revert this broader fix-round machinery to the minimal targeted change and normalize before financial width allocation.frontend/src/lib/printer/kot-web-print.ts:153- Frontend thermal timestamps do not consistently use the tenant timezone. The direct browser KOT test call omitstimezone, while the receipt and tax encoders also discard the tenant timezone before formatting. A timestamp such as2026-01-01T23:30:00Zcan therefore print in the host timezone instead of the store's business-local time. Thread the existing tenant timezone through the shared frontend rendering boundary and all direct paths.main/printers/document-kot.ts:118- The new formatter removes the catalog's{number}placeholder and always inserts:. Existing labels such asCommande n° {number}andPedido N.º {number}consequently print asCommande n°: 123andPedido N.º: 123; the frontend KOT helper duplicates this logic. Interpolate the placeholder while preserving locale punctuation.frontend/src/lib/i18n/messages/de.json:683- The required goal calls for complete support across all system surfaces, but GermanprintTest.escposHintis onlyStatus: {status}while English also explainsDirect USB printing via WebUSB; the German print-test UI omits the transport guidance.frontend/src/lib/i18n/messages/de.json:1510- The German printer setting text says Arabic/Persian text is sent normally when enabled, but omits the safety condition to enable it only for printers that render it correctly and omits that unsupported lines are skipped when disabled. This leaves German operators without the setting's actual failure behavior.frontend/src/lib/i18n/messages/de.json:2256- German WhatsApp pairing instructions stop after saying Flo generates an 8-digit code and afterGerät verknüpfen; they omit the required step of entering the code and selecting phone-number linking. A German user following the displayed fallback instructions cannot complete pairing.frontend/src/lib/i18n/messages/de.json:1612- The German station hint only describes the no-categories case. It omits the equally important no-printer case from the English contract, where the station claims no items and those items fall back to the default printer, so German operators can misunderstand station routing.🔧 Fix: Preserve German thermal layout and localized print semantics
8 issues (4 errors, 4 warnings) still open:
main/printers/thermal.ts:1584- The intent requires complete thermal receipt/KOT support. German transliteration occurs after wrapping and padding, so a 42-column line containingücan become 43 columns and overflow. Revert the fixer-authored late-normalization machinery to pre-layout normalization, or authorize a broader fix.main/printers/thermal.ts:1146- When a compliance template omits explicit line-item columns,pluginItemRowsuses German labels butpluginItemHeaderdefaults to English, producing mixed output such asItem Qty Amountabove German rows. Pass the resolved language into this shared fallback.frontend/src/lib/i18n/messages/de.json:60- The required complete German support is not met in the active recovery flow: this message omits that no OS keyring makes local recovery impossible and omits the direct-database recovery option from English. Translate the full recovery guidance or approve the changed contract.frontend/src/lib/i18n/messages/de.json:2153- The German tax subtitle changes the behavior description from enabling verified country rules, automatic standard product tax assignment, and per-product exceptions to a generic instruction to configure VAT. This can mislead operators about tax activation and overrides.frontend/src/lib/i18n/messages/de.json:1839- The German permission-matrix description says roles can be configured, while the UI is explicitly read-only and the following note says role configuration is unavailable. This contradicts the required authentic German support and can create a false security expectation.frontend/src/lib/i18n/messages/de.json:1604- The German Linux update hint omits that Flo's in-app updater is not used and that AppImage builds update automatically, leaving operators without the update-path guidance shown in English.frontend/src/lib/i18n/messages/de.json:2195- The German beta-unavailable message omits the actionable instruction to update the desktop app to opt in, so users are told the feature is unavailable without the documented next step.frontend/src/lib/i18n/messages/de.json:2284- The German WhatsApp enablement guidance omits the safeguards to message only customers who expect WhatsApp and keep their records current. Those operational and consent instructions are part of the displayedfloHelpscopy and required authentic support.🔧 Fix: Fix German thermal layout and operational translations
3 issues (2 errors, 1 warning) still open:
frontend/src/app/(dashboard)/print-test/page.tsx:151- The print-test selector still renders five hardcoded English labels instead of the existing GermanprintTest.option*translations, violating the required complete German support across all system surfaces.frontend/src/lib/printer/receipt-encoder.ts:423- Thermal WebUSB receipts remain incomplete: compact headers are hardcoded English, while German classic 58mm headers exceed their fixed cell widths and overflow; large-value fallback rows also use EnglishRate/Amount.frontend/src/hooks/usePrinter.ts:253- The browser tax-print fallback omitsTaxBillOptions.language, so an explicit German request can silently render using the stored English policy.🔧 **Test** - 4 issues found → auto-fixed ✅
frontend/src/lib/printer/unicode.ts:40- German ESC/POS transliteration maps uppercaseÜto mixed-caseUe, producingKUeCHENBESTELLSCHEINinstead of uppercase-safeKUECHENBESTELLSCHEIN;npm run test:print-labelsfails this assertion.main/printers/document-kot.ts:131- The document-driven KOT renderer changes the existing English output fromOrder: ORD-PARITY-001toOrder #ORD-PARITY-001, failing legacy parity at 32, 42, and 48 columns.frontend/src/lib/printer/kot-encoder.ts:170- The desktop frontend build fails TypeScript checking on impossiblelanguage === 'en'comparisons infrontend/src/lib/printer/kot-encoder.ts:170,frontend/src/lib/printer/kot-web-print.ts:109, andshared/print/document.ts:463; static export and lazy chunk verification are blocked.agent.browsers.list()returned[]).npm ci --ignore-scripts --no-audit --no-fundnpm run test:translationsnpm run test:print-labelsnode scripts/generate-print-labels.cjs --checknpm run test:print-paritynpm run test:print-documentnpm run test:print-kernelnpm run test:kot-locale-cold-startnpm run test:first-runnpm run test:i18n-ssr-timezonenpm run test:decoupled-ui-localenpm run test:i18n-audit-remediationsEVIDENCE_DIR=... npm run test:browser-receiptsNEXT_BUILD_MODE=desktop npm --prefix frontend run buildnpm run test:locale-chunksdirectgenerateBillHtml(..., { language: "de" })andgenerateKotHtml(..., { language: "de" })renderer callsbrowser runtime setup andagent.browsers.list()finalgit status --short --branchand transient-artifact cleanup🔧 Fix: Fix German thermal casing, KOT parity, and TypeScript build
✅ Re-checked - no issues remain.
npm cinpm ci --prefix frontendnpm run test:translationsnpm run test:print-labelsnpm run test:print-kernelnpm run test:print-paritynpm run test:browser-receiptsnpm run test:decoupled-ui-localenpm run test:i18n-audit-remediationsnpm run test:i18n-ssr-timezonenpm run test:kot-locale-cold-startnpm run build:frontendnpm run test:locale-chunksnpm run buildnpm run test:print-documentnpm run test:first-runnpm run test:country-localizationnpm run test:issue-133-kds-kot-togglesHeadless Playwright English-to-German switch on built/setup/routeHeadless Playwright screenshots of generated German receipt and KOT HTMLVisual inspection of German Setup, receipt, and KOT screenshotsgit diff --check 899efa94cb51d1a8d95b7c0c6afdd189d4df7405..3ad03f20d1ced56d4ea460a33a820a4fd7f7c801git status --short --branch✅ **Document** - passed
✅ No issues found.
eslint: command not found).✅ **Push** - passed
✅ No issues found.