feat(i18n): Make Builder UI translatable - #706
Conversation
- load authenticated Frappe translations before the initial router navigation - add fallback, timeout, extraction, endpoint, and browser coverage
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains; the previously reported AbortController path has been removed. Reviews (6): Last reviewed commit: "fix(i18n): regenerate POT and restore qu..." | Re-trigger Greptile |
|
@surajshetty3416 The implementation and follow-up review fix are ready. Greptile is 5/5 and the addressed thread is resolved. Linters, UI Test, and Server Tests are currently |
Integrate the latest Builder token, sidebar, analytics, and CI changes while preserving the verified translation foundation.
|
Updated the branch with a normal merge of current develop (�093eab6). The PR is now conflict-free and GitHub reports it as mergeable. Fresh validation against this exact merge head passed: translation helper 12/12, production build (2,611 modules), full Builder server suite 86/86 including real POT extraction, and Cypress i18n 3/3 in Chrome with retries disabled. Greptile has also re-reviewed the new head at 5/5. The new Linters, Server Tests, and UI Test runs are still �ction_required and need maintainer approval: 30861276815, 30861276820, 30861276856. @surajshetty3416 could you approve those workflows and review when convenient? |
The custom `builder.api.get_translations` endpoint is replaced by boot
injection, the pattern CRM uses. `_builder.py` puts the dictionary into
`context.boot`, which the frappe-ui vite plugin already renders into the
page as `window.translated_messages`.
This removes a request from startup. The app no longer awaits translations
before `createApp`, so there is no blank `#app` and no 5s timeout fallback,
and the dictionary is in place before any component renders.
It also keeps v15 working. `frappe.translate.get_boot_translations`, the
framework endpoint this would otherwise call, does not exist there, while
`get_translations_from_apps` and `get_user_translations` do.
Only Builder's own catalog is loaded. `get_all_translations` merges every
installed app, which measured 5929 entries / 434 KB for German on a bench
with just frappe, builder and polls installed. The editor can only ever
look up strings from Builder's own POT, so scoping to `["builder"]` brings
that to 57 bytes. Site level Translation overrides are still applied.
`lib.d.ts` goes back to being an ambient declaration file. The added
`export {}` had turned it into a module, which downgraded
`declare module "webfontloader"` from a global shim to an augmentation of
an untyped package. Those declarations now live in `translation.ts`, which
is already a module.
Drops the bespoke vm/esbuild test harness and the three Cypress specs,
which covered the fetch, abort and timeout paths that no longer exist. The
POT test now runs the extractors over `frontend/src` directly instead of
walking the whole app, so it no longer trips over the `frappe-ui`
submodule on a local bench, and it runs in a fraction of the time.
Co-Authored-By: Claude <noreply@anthropic.com>
Without these, `__()` calls never reach translators. `generate-pot-file.yml` regenerates `builder/locale/main.pot` weekly and opens a PR, and `crowdin.yml` points Crowdin at that POT so it can write back `locale/<lang>.po`. Both are ported from CRM. Includes the first generated POT. Remaining setup is manual: bump frappe-pr-bot to write access on the repo and add frappe/builder to the Frappe project in Crowdin. The RELEASE_TOKEN secret the workflow needs is already present. Co-Authored-By: Claude <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #706 +/- ##
===========================================
+ Coverage 59.59% 60.07% +0.47%
===========================================
Files 35 36 +1
Lines 4413 4451 +38
===========================================
+ Hits 2630 2674 +44
+ Misses 1783 1777 -6 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Gives translators a discoverable entry point, matching how frappe and helpdesk surface it. Points at the shared Frappe project, which already exists, so the link is valid before Builder's own integration is wired up. Co-Authored-By: Claude <noreply@anthropic.com>
The committed POT still listed a string from a helper that was dropped before the last push, so it referenced a line that no longer exists. Wrapping the unpublish prompt had also dropped the quotes around the page title, leaving `unpublish Home?` where develop reads `unpublish "Home"?`. The quotes matter when a title contains spaces, so they are back in the msgid. Folds get_translations into get_boot, its only caller, and drops the executable bit on the helper script to match install_dependencies.sh. The workflow invokes it via `bash`, so the bit was never read. Co-Authored-By: Claude <noreply@anthropic.com>
|
#721 to translate all user facing strings |
|
🎉 This PR is included in version 1.33.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Summary