WEB-1007: Add i18n support for Mifos Copilot across all 13 locales#3671
Conversation
|
Note
|
| Layer / File(s) | Summary |
|---|---|
Translation key definitions src/assets/translations/en-US.json, src/assets/translations/cs-CS.json, src/assets/translations/de-DE.json, src/assets/translations/es-CL.json, src/assets/translations/es-MX.json, src/assets/translations/fr-FR.json, src/assets/translations/it-IT.json, src/assets/translations/ko-KO.json, src/assets/translations/lt-LT.json, src/assets/translations/lv-LV.json, src/assets/translations/ne-NE.json, src/assets/translations/pt-PT.json, src/assets/translations/sw-SW.json |
Adds a new top-level copilot translation object to the canonical en-US file and replicates the same key structure in 14 additional locale files, covering brand, session/chat controls, greetings, suggestions, input controls, disclaimer, navigation, help/capabilities, card types, and confirmation text. |
TranslateModule wiring in all Copilot components src/app/copilot/components/action-card/action-card.component.ts, src/app/copilot/components/chat-area/chat-area.component.ts, src/app/copilot/components/copilot-header/copilot-header.component.ts, src/app/copilot/components/input-bar/input-bar.component.ts, src/app/copilot/components/quick-chips/quick-chips.component.ts, src/app/copilot/components/recent-chats/recent-chats.component.ts, src/app/copilot/components/copilot-panel/copilot-panel.component.ts |
Adds TranslateModule to the imports array of six standalone components. CopilotPanelComponent additionally injects TranslateService for runtime translation. |
Panel logic: translation keys for greetings, suggestions, and prompt dispatch src/app/copilot/components/copilot-panel/copilot-panel.component.ts |
emptySuggestions values and greetingTime return values are changed from English strings to copilot.* translation keys. sendSuggestedPrompt now calls translate.instant() on the key before forwarding the resolved text to sendMessage. |
displayName input removal src/app/copilot/components/chat-area/chat-area.component.ts, src/app/copilot/components/copilot-panel/copilot-panel.component.html |
Removes the @Input() displayName property from ChatAreaComponent and removes the [displayName] binding from the mifosx-chat-area element in the panel template. |
Template i18n: translate pipe bindings across all Copilot templates src/app/copilot/components/action-card/action-card.component.html, src/app/copilot/components/chat-area/chat-area.component.html, src/app/copilot/components/copilot-header/copilot-header.component.html, src/app/copilot/components/copilot-panel/copilot-panel.component.html, src/app/copilot/components/input-bar/input-bar.component.html, src/app/copilot/components/quick-chips/quick-chips.component.html, src/app/copilot/components/recent-chats/recent-chats.component.html |
Replaces all remaining hardcoded English strings in templates with ` |
Estimated code review effort
🎯 2 (Simple) | ⏱️ ~10 minutes
Possibly related PRs
- openMF/web-app#3648: Introduced the Copilot feature components (
action-card,chat-area,copilot-panel, etc.) with the hardcoded English strings that this PR replaces with translation keys.
Suggested reviewers
- adamsaghy
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
| Check name | Status | Explanation |
|---|---|---|
| Description Check | ✅ Passed | Check skipped - CodeRabbit’s high-level summary is enabled. |
| Title check | ✅ Passed | The pull request title accurately summarizes the main change: introducing i18n support for Mifos Copilot across 13 locales, which is precisely what the changeset implements. |
| Docstring Coverage | ✅ Passed | No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. |
| Linked Issues check | ✅ Passed | Check skipped because no linked issues were found for this pull request. |
| Out of Scope Changes check | ✅ Passed | Check skipped because no linked issues were found for this pull request. |
✏️ Tip: You can configure your own custom pre-merge checks in the settings.
✨ Finishing Touches
🧪 Generate unit tests (beta)
- Create PR with unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands and usage tips.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/assets/translations/lv-LV.json`:
- Around line 4868-4871: In the lv-LV.json file, the keys
copilot.nav.preferences and copilot.preferencesHeading currently have English
values ("Preferences") instead of Latvian translations. Locate these two keys in
the translation object (around the helpCenter entry which is already translated)
and replace their English values with appropriate Latvian translations to
maintain consistency with the rest of the translated UI labels in this locale
file.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: a0a8e2d4-2350-4752-bcd6-b54047cbffd9
📒 Files selected for processing (27)
src/app/copilot/components/action-card/action-card.component.htmlsrc/app/copilot/components/action-card/action-card.component.tssrc/app/copilot/components/chat-area/chat-area.component.htmlsrc/app/copilot/components/chat-area/chat-area.component.tssrc/app/copilot/components/copilot-header/copilot-header.component.htmlsrc/app/copilot/components/copilot-header/copilot-header.component.tssrc/app/copilot/components/copilot-panel/copilot-panel.component.htmlsrc/app/copilot/components/copilot-panel/copilot-panel.component.tssrc/app/copilot/components/input-bar/input-bar.component.htmlsrc/app/copilot/components/input-bar/input-bar.component.tssrc/app/copilot/components/quick-chips/quick-chips.component.htmlsrc/app/copilot/components/quick-chips/quick-chips.component.tssrc/app/copilot/components/recent-chats/recent-chats.component.htmlsrc/app/copilot/components/recent-chats/recent-chats.component.tssrc/assets/translations/cs-CS.jsonsrc/assets/translations/de-DE.jsonsrc/assets/translations/en-US.jsonsrc/assets/translations/es-CL.jsonsrc/assets/translations/es-MX.jsonsrc/assets/translations/fr-FR.jsonsrc/assets/translations/it-IT.jsonsrc/assets/translations/ko-KO.jsonsrc/assets/translations/lt-LT.jsonsrc/assets/translations/lv-LV.jsonsrc/assets/translations/ne-NE.jsonsrc/assets/translations/pt-PT.jsonsrc/assets/translations/sw-SW.json
Migrate every user-facing string in the Copilot UI from hardcoded English to @ngx-translate/core. Introduce a dedicated copilot.* translation namespace (46 keys) and add real translations for all 13 supported locales (en-US, es-MX, es-CL, fr-FR, de-DE, it-IT, pt-PT, ko-KO, lt-LT, lv-LV, ne-NE, sw-SW, cs-CS). Refactor copilot-header, copilot-panel, chat-area, action-card, input-bar, quick-chips and recent-chats to use the translate pipe and TranslateService. The time-of-day greeting and suggestion prompts use translation keys resolved at send time, the action-card badge uses a composed cardType key, and accessibility labels (aria-label, title, placeholder) are bound translations. Remove the now-unused displayName input.
73366f5 to
cc77248
Compare
Migrate every user-facing string in the Copilot UI from hardcoded English to @ngx-translate/core. Introduce a dedicated copilot.* translation namespace (46 keys) and add real translations for all 13 supported locales (en-US, es-MX, es-CL, fr-FR, de-DE, it-IT, pt-PT, ko-KO, lt-LT, lv-LV, ne-NE, sw-SW, cs-CS).
Refactor copilot-header, copilot-panel, chat-area, action-card, input-bar, quick-chips and recent-chats to use the translate pipe and TranslateService. The time-of-day greeting and suggestion prompts use translation keys resolved at send time, the action-card badge uses a composed cardType key, and accessibility labels (aria-label, title, placeholder) are bound translations. Remove the now-unused displayName input.
Verification
copilot.*key referenced in the components resolves to a real string.ng buildpasses with zero errors.WEB-1007
Please make sure these boxes are checked before submitting your pull request - thanks!
If you have multiple commits please combine them into one commit by squashing them.
Read and understood the contribution guidelines at
web-app/.github/CONTRIBUTING.md.Summary by CodeRabbit