Skip to content

fix(l10n): 209 Dutch strings that never reached the browser - #493

Merged
rubenvdlinde merged 1 commit into
developmentfrom
fix/l10n-js-catalogues
Aug 30, 2026
Merged

rubenvdlinde merged 1 commit into
developmentfrom
fix/l10n-js-catalogues

Conversation

@rubenvdlinde

Copy link
Copy Markdown
Contributor

thematiq shipped 37 l10n/*.json catalogues and zero l10n/*.js.

Nextcloud reads the .json server-side for PHP $l->t(). The browser only ever sees the OC.L10N.register() call in the .js. So all 209 Dutch translations in this app were inert in the frontend.

That matters more here than anywhere else in the fleet: this is the NL Design System app, whose entire purpose is Dutch government theming, and its settings UI rendered in English to an account set to Dutch. Strings like "Selecteer een Nederlandse overheidsontwerp-tokenset als basis" were already written and already correct, and no user ever saw them.

Measured across the fleet on development: openregister 37/38, opencatalogi 37/38, dossiq 38/39, petstore 38/38 — and thematiq 0/37. nextcloud-app-template had the same gap, fixed in ConductionNL/nextcloud-app-template#186.

The generator

scripts/build-l10n-js.js is petstore's, adopted unchanged rather than reimplemented, plus l10n:build and check:l10n-js so the two halves cannot drift apart again. Apps carrying that check have measured zero drift; apps without it accumulated between 142 and 1,090 unreachable entries.

Verification

  • 37 .js written; the register call names thematiq, read from appinfo/info.xml rather than hardcoded.
  • nl.js carries 209 keys with real Dutch values, spot-checked rather than counted.
  • Every generated file passes node --check, and none is empty — an empty file passes node --check, so size was checked separately.
  • check:l10n-js exits 0.
  • Manifest l10n coverage: 0 strings missing from nl.json.

🤖 Generated with Claude Code

thematiq shipped 37 l10n/*.json catalogues and zero l10n/*.js. Nextcloud reads
the .json server-side for PHP $l->t(); the browser only ever sees the
OC.L10N.register() call in the .js. So every one of the 209 Dutch translations
in this app was inert in the frontend.

That matters more here than anywhere else in the fleet: this is the NL Design
System app, whose entire purpose is Dutch government theming, and its settings
UI rendered in English to a Dutch account.

The generator is petstore's scripts/build-l10n-js.js adopted unchanged, with
l10n:build and check:l10n-js so the two halves cannot drift apart again.

Verified: 37 .js written, the register call names thematiq (read from
appinfo/info.xml), nl.js carries 209 keys with real Dutch values, every file
passes node --check and none is empty, and check:l10n-js exits 0.
@github-actions

Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/thematiq @ e95eaa0

Check PHP Vue Security License Tests
lint ✅
phpcs ✅
phpmd ✅
psalm ✅
phpstan ✅
phpmetrics ✅
eslint ✅
stylelint ✅
build ✅
check-manifest ✅
test-l10n ✅
format ✅
composer ✅ ✅ 104/104
npm ✅ ✅ 2/2
app:check-code ⏭️
info.xml ✅
REUSE ❌
PHPUnit ✅
Newman ✅
Playwright 🚨 NO VERDICT — enabled but never ran
Hydra gates ✅

Quality workflow — 2026-08-30 17:21 UTC

Download the full PDF report from the workflow artifacts.

@rubenvdlinde

Copy link
Copy Markdown
Contributor Author

Refining one line in the description, because the mechanism is worth stating precisely.

I wrote that the .js is "the only thing the browser ever sees". That is the generator script's wording and it is slightly too strong. What the code in these repos actually says:

  • Apps do call loadTranslations('<app>', …), which fetches l10n/<locale>.json at runtime.
  • But on many installs, including this fleet's standard dev container, Apache only lets the JS/CSS allowlist through and rewrites everything else to index.php. There is no route for /custom_apps/<app>/l10n/<locale>.json, so the fetch fails and loadTranslations rejects. src/main.js documents this and deliberately mounts anyway: "Strings just fall back to their English source on miss."
  • l10n/<locale>.js is an OC.L10N.register() call loaded as a <script>, so it rides the allowlist and works where the JSON does not.

So the accurate claim is: the JSON path is real but unreliable, the .js path is the one that survives, and shipping only .json is what produces a Dutch account reading English. The fix in this PR is unchanged.

@rubenvdlinde
rubenvdlinde merged commit f819b1d into development Aug 30, 2026
45 checks passed
@rubenvdlinde
rubenvdlinde deleted the fix/l10n-js-catalogues branch August 30, 2026 17:39
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