WEB-893: Replace hardcoded 'Reload Settings' strings with translate p…#3441
WEB-893: Replace hardcoded 'Reload Settings' strings with translate p…#3441ayu-yishu13 wants to merge 1 commit intoopenMF:devfrom
Conversation
|
Note
|
| Cohort / File(s) | Summary |
|---|---|
Login component src/app/login/login.component.html, src/app/login/login.component.ts |
Replaced static title, matTooltip, and aria-label values with translation bindings for "Reload Settings"; added MatTooltip to the component's standalone imports. |
Translations (multiple locales) src/assets/translations/en-US.json, src/assets/translations/... |
Added "Reload Settings": "Reload Settings" entry under labels.buttons/buttons in many locale JSON files (new i18n key across locales). |
Estimated code review effort
🎯 2 (Simple) | ⏱️ ~10 minutes
Possibly related PRs
- WEB-563 feat(login): modernize login UI with Material Design 3 and pr… #3061 — Previously introduced the reload-settings button with static strings; closely related change converting those strings to translation bindings.
Suggested reviewers
- IOhacker
- alberto-art3ch
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
| Check name | Status | Explanation |
|---|---|---|
| Description Check | ✅ Passed | Check skipped - CodeRabbit’s high-level summary is enabled. |
| Title check | ✅ Passed | The title clearly and concisely summarizes the main change: replacing hardcoded 'Reload Settings' strings with translation pipe support. |
| Docstring Coverage | ✅ Passed | No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. |
✏️ 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 the current code and only fix it if needed.
Inline comments:
In `@src/assets/translations/en-US.json`:
- Line 623: Add the new i18n key labels.buttons.Reload Settings (introduced in
en-US.json) to the 12 missing locale files (cs-CS, de-DE, es-CL, es-MX, fr-FR,
it-IT, ko-KO, lt-LT, lv-LV, ne-NE, pt-PT, sw-SW) with appropriate translations
or placeholder values, then run the extraction script (npm run
translations:extract) to update translation scaffolding and ensure the new key
propagates to tooltips, titles, and ARIA labels; reference the key
labels.buttons.Reload Settings when making the changes so the string is present
and consistent across all locales.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: a9d51bc5-99a3-438d-890e-5fab5e5c39d0
📒 Files selected for processing (3)
src/app/login/login.component.htmlsrc/app/login/login.component.tssrc/assets/translations/en-US.json
| "DONE": "Done", | ||
| "Submitting": "Submitting" | ||
| "Submitting": "Submitting", | ||
| "Reload Settings": "Reload Settings" |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Verify whether "labels.buttons.Reload Settings" exists in every translation file.
python - <<'PY'
import json, glob
files = sorted(glob.glob("src/assets/translations/*.json"))
missing = []
for f in files:
with open(f, "r", encoding="utf-8") as fh:
data = json.load(fh)
ok = (
isinstance(data, dict)
and "labels" in data
and isinstance(data["labels"], dict)
and "buttons" in data["labels"]
and isinstance(data["labels"]["buttons"], dict)
and "Reload Settings" in data["labels"]["buttons"]
)
if not ok:
missing.append(f)
print("Missing key in:" if missing else "Key present in all translation files.")
for m in missing:
print(m)
PYRepository: openMF/web-app
Length of output: 493
🏁 Script executed:
# Search for "Reload Settings" usage in code
rg "Reload Settings" --type ts --type tsx --type js --type jsx --type html -A 2 -B 2Repository: openMF/web-app
Length of output: 85
🏁 Script executed:
# Check if npm run translations:extract exists
cat package.json | jq '.scripts | keys[] | select(contains("extract"))' 2>/dev/null || echo "No extract scripts found"Repository: openMF/web-app
Length of output: 80
🏁 Script executed:
# Check if en-US.json is properly formatted with prettier (look at line 623 and surrounding context)
head -n 630 src/assets/translations/en-US.json | tail -n 15Repository: openMF/web-app
Length of output: 577
🏁 Script executed:
# Search for "Reload Settings" usage in all code files (retry with correct approach)
rg "Reload Settings" --type ts --type js --type html -A 2 -B 2 2>/dev/null || rg "Reload Settings" --include="*.ts" --include="*.js" --include="*.html" -A 2 -B 2Repository: openMF/web-app
Length of output: 654
🏁 Script executed:
# Check if Prettier is configured and whether it processes JSON
cat .prettierrc* 2>/dev/null || cat package.json | jq '.prettier' 2>/dev/null || echo "No prettier config found as separate file"Repository: openMF/web-app
Length of output: 206
🏁 Script executed:
# Verify that the PR actually changed line 623 (check if this is a new addition)
git diff --no-color src/assets/translations/en-US.json | head -40Repository: openMF/web-app
Length of output: 40
🏁 Script executed:
# Check if the JSON file would pass prettier formatting check
npx prettier --check src/assets/translations/en-US.json 2>&1 | head -20Repository: openMF/web-app
Length of output: 272
Add missing "Reload Settings" key to all 12 locale files.
The key labels.buttons.Reload Settings added at line 623 of en-US.json is missing from: cs-CS.json, de-DE.json, es-CL.json, es-MX.json, fr-FR.json, it-IT.json, ko-KO.json, lt-LT.json, lv-LV.json, ne-NE.json, pt-PT.json, and sw-SW.json.
Without translations in these locales, users will see the raw key labels.buttons.Reload Settings in tooltips, titles, and ARIA labels instead of a translated label, degrading UX and accessibility. Run npm run translations:extract as specified in the coding guidelines when adding new i18n strings.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/assets/translations/en-US.json` at line 623, Add the new i18n key
labels.buttons.Reload Settings (introduced in en-US.json) to the 12 missing
locale files (cs-CS, de-DE, es-CL, es-MX, fr-FR, it-IT, ko-KO, lt-LT, lv-LV,
ne-NE, pt-PT, sw-SW) with appropriate translations or placeholder values, then
run the extraction script (npm run translations:extract) to update translation
scaffolding and ensure the new key propagates to tooltips, titles, and ARIA
labels; reference the key labels.buttons.Reload Settings when making the changes
so the string is present and consistent across all locales.
IOhacker
left a comment
There was a problem hiding this comment.
There are missing languages in the i18n files
…ipe in login component
|
@IOhacker Added the Reload Settings translation key to all 12 locale files. Please re-review! |
Description
The reload button in the login component footer had three hardcoded English strings that were not using the i18n translate pipe:
title="Reload Settings"matTooltip="Reload Settings"attr.aria-label="Reload Settings"These have been replaced with the translate pipe and the translation key
labels.buttons.Reload Settingshas been added to the i18n JSON file.Related issues and discussion
https://mifosforge.jira.com/jira/software/c/projects/WEB/issues/WEB-893
Screenshots, if any
No UI changes — tooltip and aria-label behavior unchanged, now i18n compatible.
Checklist
web-app/.github/CONTRIBUTING.md.Summary by CodeRabbit
New Features
Chores