Skip to content

WEB-893: Replace hardcoded 'Reload Settings' strings with translate p…#3441

Open
ayu-yishu13 wants to merge 1 commit intoopenMF:devfrom
ayu-yishu13:WEB-893
Open

WEB-893: Replace hardcoded 'Reload Settings' strings with translate p…#3441
ayu-yishu13 wants to merge 1 commit intoopenMF:devfrom
ayu-yishu13:WEB-893

Conversation

@ayu-yishu13
Copy link
Copy Markdown

@ayu-yishu13 ayu-yishu13 commented Mar 24, 2026

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 Settings has 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

  • 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

  • New Features

    • Tooltips, titles and accessibility labels for the "Reload Settings" button now use translation keys so the button displays localized text and tooltips.
  • Chores

    • Added "Reload Settings" translation entries across multiple languages (including English and several locales) to support the new localized label.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 24, 2026

Note

.coderabbit.yaml has unrecognized properties

CodeRabbit is using all valid settings from your configuration. Unrecognized properties (listed below) have been ignored and may indicate typos or deprecated fields that can be removed.

⚠️ Parsing warnings (1)
Validation error: Unrecognized key(s) in object: 'pre_merge_checks'
⚙️ Configuration instructions
  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 4c8a3956-6305-4953-b0b9-a62447937fb3

📥 Commits

Reviewing files that changed from the base of the PR and between fa0c058 and 4673726.

📒 Files selected for processing (15)
  • src/app/login/login.component.html
  • src/app/login/login.component.ts
  • src/assets/translations/cs-CS.json
  • src/assets/translations/de-DE.json
  • src/assets/translations/en-US.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
✅ Files skipped from review due to trivial changes (14)
  • src/app/login/login.component.ts
  • src/app/login/login.component.html
  • src/assets/translations/it-IT.json
  • src/assets/translations/de-DE.json
  • src/assets/translations/ne-NE.json
  • src/assets/translations/pt-PT.json
  • src/assets/translations/lt-LT.json
  • src/assets/translations/es-MX.json
  • src/assets/translations/cs-CS.json
  • src/assets/translations/fr-FR.json
  • src/assets/translations/lv-LV.json
  • src/assets/translations/ko-KO.json
  • src/assets/translations/sw-SW.json
  • src/assets/translations/es-CL.json
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/assets/translations/en-US.json

Walkthrough

Replaced hard-coded title/tooltip/aria-label on the login "Reload Settings" button with Angular translation bindings and added MatTooltip to the login component imports; added the Reload Settings key to multiple translations files.

Changes

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

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between f82ad09 and fa0c058.

📒 Files selected for processing (3)
  • src/app/login/login.component.html
  • src/app/login/login.component.ts
  • src/assets/translations/en-US.json

"DONE": "Done",
"Submitting": "Submitting"
"Submitting": "Submitting",
"Reload Settings": "Reload Settings"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 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)
PY

Repository: 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 2

Repository: 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 15

Repository: 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 2

Repository: 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 -40

Repository: 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 -20

Repository: 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.

Copy link
Copy Markdown
Contributor

@IOhacker IOhacker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are missing languages in the i18n files

@ayu-yishu13
Copy link
Copy Markdown
Author

@IOhacker Added the Reload Settings translation key to all 12 locale files. Please re-review!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants