Skip to content

feat(i18n): Make Builder UI translatable - #706

Merged
surajshetty3416 merged 7 commits into
frappe:developfrom
mardausdennis:feat/builder-i18n-foundation
Aug 8, 2026
Merged

feat(i18n): Make Builder UI translatable#706
surajshetty3416 merged 7 commits into
frappe:developfrom
mardausdennis:feat/builder-i18n-foundation

Conversation

@mardausdennis

@mardausdennis mardausdennis commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add an authenticated GET-only endpoint for the current user's Frappe translations
  • load translations before Builder's initial router navigation, with English error and timeout fallback
  • localize representative Builder strings and register TypeScript extraction

- load authenticated Frappe translations before the initial router navigation
- add fallback, timeout, extraction, endpoint, and browser coverage
@greptile-apps

greptile-apps Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5

The 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

Comment thread frontend/src/translation.ts Outdated
@mardausdennis

Copy link
Copy Markdown
Contributor Author

@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 action_required with 0 jobs executed, so they still need maintainer approval to run. Could you approve the workflows and review the PR when convenient?

Integrate the latest Builder token, sidebar, analytics, and CI changes while preserving the verified translation foundation.
@mardausdennis

Copy link
Copy Markdown
Contributor Author

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?

surajshetty3416 and others added 2 commits August 8, 2026 18:01
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

codecov Bot commented Aug 8, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.36842% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 60.07%. Comparing base (fdf6a27) to head (42a572e).
⚠️ Report is 15 commits behind head on develop.

Files with missing lines Patch % Lines
builder/www/_builder.py 85.71% 1 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

surajshetty3416 and others added 2 commits August 8, 2026 18:15
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>
@surajshetty3416 surajshetty3416 changed the title feat: add translation foundation feat(i18n): Make Builder UI translatable Aug 8, 2026
@surajshetty3416
surajshetty3416 merged commit 7418f2c into frappe:develop Aug 8, 2026
11 checks passed
@surajshetty3416

Copy link
Copy Markdown
Member

#721 to translate all user facing strings

@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 1.33.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants