Add full translation support to the crm_dashboard module and localize all user-facing strings so the dashboard respects the user's language.#423
Open
maurorosero wants to merge 5 commits into
Conversation
…model - Use babel.dates to render month names in the user's language instead of hardcoded English via calendar.month_name / TO_CHAR. - Read mail_activity_type.name from the user's lang (translate=True field) with fallback to en_US instead of forcing 'en_US'. - Wrap 'Expected without Won', 'Won', 'Lost' with _() for translation. - Group lost-leads query by month number (locale-independent) and label months on the Python side to keep ordering stable across DB locales.
- Import _t from @web/core/l10n/translation. - Pre-translate all visible UI strings (titles, period labels, chart legends, action names) into a state.texts map so they can be looked up from the QWeb template, which has no _t in its context. - Wrap action.doAction 'name' and Chart.js 'label' strings with _t().
…le strings Replace all hardcoded English text in dashboard_templates.xml with state.texts.* lookups, which are pre-translated in crm_dashboard.js via _t(). This allows the dashboard UI to be translated per-user.
Minor version bump for translation/i18n improvements.
Add .po files for English (en), Spanish variants (es, es_419, es_AR, es_CL, es_CO, es_MX, es_PA, es_PE, es_VE) and Portuguese variants (pt, pt_BR, pt_PT).
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.
Changes
Model (
models/crm_lead.py)babel.datesusing the user's language instead of hardcoded English (calendar.month_name) or DB-locale-dependentTO_CHAR.mail_activity_type.name(atranslate=TrueJSONB field) from the user's lang with fallback toen_US, instead of forcingen_US.Expected without Won,Won,Lost) with_()for translation.JavaScript (
static/src/js/crm_dashboard.js)_tfrom@web/core/l10n/translation.state.textsmap so they can be consumed from the QWeb template, which has no_tin its context.action.doActionnameand Chart.jslabelstrings with_t().QWeb template (
static/src/xml/dashboard_templates.xml)state.texts.*lookups so the rendered UI follows the current user's language.Manifest
19.0.1.0.0→19.0.1.0.1.i18n
.pofiles for:en,es,es_419,es_AR,es_CL,es_CO,es_MX,es_PA,es_PE,es_VE,pt,pt_BR,pt_PT.