Repository navigation
fix(i18n): load translations at startup and translate missed LMS strings - #3296
Merged
Merged
Conversation
- Load translations before mounting: __() in setup() and module scope ran
before the messages arrived and stayed English.
- Extract frontend/src/**.ts (babel_extractors.csv): ~216 strings in .ts
files never reached the pot.
- Wrap untranslated copy (settings definitions, shared field renderers,
empty states, statistics, status and option values) and replace glued
fragments with single templates ("{0}% completed", "{0} of {1}",
"Active Batches", counts with plural forms).
- Fill lms/locale/ar.po: every msgid has Arabic, and 243 wrong Crowdin
entries are corrected against one glossary (Score, Clear, Edit,
Collapse, Title, Notifications...).
- Translated sidebar collapse button in place of frappe-ui's hardcoded one.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Translate at render what module scope evaluated before the messages
loaded: settings page titles (Categories, Coupons), the list's create
label (Assign) and ChildTable's column headers (test case Input,
Expected Output, Hidden).
- Extract strings that never reached the pot: Payment Gateways and
Google Meet Settings empty states, the mobile Pages heading and the
Custom email provider tile (now a translated label on the service).
- Template the evaluation event title ("{0}'s Evaluation") and the job
application email subject; give the job form selects a translated
placeholder.
- Make side-specific copy direction-neutral: the new-quiz empty state and
the brand settings no longer say "on the right" / "left sidebar".
- Localize dates: timeAgo uses dayjs (with the site locale) instead of
vueuse's English-only useTimeAgo, and the quiz submission date and
times use dayjs formats instead of the browser locale.
- Show the error's message in the job applications toasts; they were
handed the Error object and rendered blank.
- ar.po: Arabic for the new msgids, and «{0}» in place of "{0}" / '{0}'
so quoted values stay attached in RTL.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
raizasafeel
added a commit
to raizasafeel/lms
that referenced
this pull request
Nov 16, 2026
Contributor
Author
|
@greptile review |
Contributor
[High impact] Appears safe to merge with the remaining non-blocking translation issue. Reviews (3) · Last reviewed commit: "fix(i18n): allow boot translations throu..." · Reviewed by Greptile |
Comment on lines
+48
to
+54
| const request = (window.lmsTranslations || fetchTranslations()).then( | ||
| (messages) => { | ||
| window.translatedMessages = messages | ||
| } | ||
| ) | ||
| const timeout = new Promise((resolve) => setTimeout(resolve, MOUNT_WAIT_MS)) | ||
| return Promise.race([request, timeout]) |
Contributor
There was a problem hiding this comment.
Late translations leave English text
When translations take more than three seconds, the app mounts in English. Assigning window.translatedMessages later does not tell Vue to redraw, and setup-time strings such as submission filters stay English until remount. Make late messages trigger updates and rebuild those strings. Add a mounted-component test rather than checking only __().
Prompt To Fix With AI
This is a comment left during a code review.
Path: frontend/src/translation.js
Line: 48-54
Comment:
**Late translations leave English text**
When translations take more than three seconds, the app mounts in English. Assigning `window.translatedMessages` later does not tell Vue to redraw, and setup-time strings such as submission filters stay English until remount. Make late messages trigger updates and rebuild those strings. Add a mounted-component test rather than checking only `__()`.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.…late messages With block_endpoints on, students and guests were refused frappe.translate.get_boot_translations, which index.html now loads translations from, so they saw English. Allow that read-only path. Messages that arrive after the mount wait now re-render templates: __() reads a version ref that the arrival bumps. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
@greptile review |
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.
Fixes LMS text that stayed in English when the UI language is Arabic.
Why
.tsfiles were never extracted for translation.What changed
index.htmlrequests translations (get_boot_translations) alongside the app bundle, like Desk does. The request is cached.babel_extractors.csvextractsfrontend/src/**.ts.{0} of {1} lessons completedand{0} students. Word order now works in Arabic.lms/auth.pyandcourse_import_export.pyuse_()with placeholders.lms/locale/*.po,main.pot) are not in this PR. The Crowdin bot regeneratesmain.potweekly and overwrites the.pofiles from Crowdin. The full Arabic translation is ready and will be uploaded to Crowdin once the new strings reach it.Screenshots
Arabic UI, right to left. Each pair is cropped to the part of the page whose text changed. Before: Arabic UI without this PR (strings left in English, glued in the wrong order). After: this PR with the Arabic translations it makes possible (to be uploaded to Crowdin).
Sidebar (1)
Admin pages (6)
Assignments (6)
Batch learning (6)
Batches (6)
Course admin (6)
Courses (5)
Jobs (6)
Learning (6)
Profile (6)
Programming Exercises (6)
Programs (6)
Taking a quiz (6)
Quizzes (6)