Skip to content

Fix #437: Translate 33 hardcoded tooltips - #439

Merged
NovaCode37 merged 2 commits into
NovaCode37:mainfrom
marioalbu08:fix/translate-hardcoded-tooltips
Oct 1, 2026
Merged

NovaCode37 merged 2 commits into
NovaCode37:mainfrom
marioalbu08:fix/translate-hardcoded-tooltips

Conversation

@marioalbu08

@marioalbu08 marioalbu08 commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Resolves #437 by migrating all hardcoded English tooltips to the i18n translation system.

Changes

  • Extracted 6 hardcoded title attributes from components/Topbar.tsx
  • Extracted 27 hardcoded title attributes from components/views/ScanResults.tsx
  • Added all 33 extracted strings to a new component namespace in messages/en.json
  • Replaced the hardcoded strings in the components with t('component.key') and i18n('component.key') respectively

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Testing

  • I have tested these changes locally
  • I have added/updated tests as needed

Screenshots

N/A (No visual changes, purely internationalization)

@github-actions github-actions Bot added the javascript Pull requests that update javascript code label Sep 30, 2026
@github-actions

Copy link
Copy Markdown

Thanks for the first pull request here. CI needs a maintainer to approve the run before it starts, so it may sit for a bit before anything happens. pytest tests/ -q passing is the main thing I look at.

@NovaCode37

Copy link
Copy Markdown
Owner

Thanks for taking all 33. Two things before this can go in.

1. en.json was re-serialized. The 33 new keys are about 35 lines, but the diff is 294 because the whole file went through a JSON writer: … and · became escape sequences and the compact one-line objects were expanded. That makes the file harder for translators to read and the PR hard to review. Please restore en.json from main and add only the new keys, by hand, next to the keys they belong with.

2. The other nine locales need the same keys. CI fails in frontend/scripts/test-i18n-keys.mjs, which requires every file in frontend/src/messages/ to have identical keys. The issue told you English was enough; that was my mistake and the issue text is fixed now. Real translations where you can, the English text where you cannot.

Smaller: the keys are all under a flat component.*. The existing ones are grouped by where they are used, topbar.* and results.*, and #444 adds aria-labels for some of the same Topbar buttons. Reusing its topbar.* keys where the text is identical saves you a few.

cd frontend && npm run test:i18n confirms the locales line up.

@marioalbu08
marioalbu08 force-pushed the fix/translate-hardcoded-tooltips branch from f78d7bc to a84d1db Compare October 1, 2026 12:00
@NovaCode37
NovaCode37 merged commit 07a9fdd into NovaCode37:main Oct 1, 2026
8 checks passed
@NovaCode37 NovaCode37 added the hacktoberfest-accepted Counts toward Hacktoberfest label Oct 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hacktoberfest-accepted Counts toward Hacktoberfest javascript Pull requests that update javascript code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Translate the 33 tooltips that are still hardcoded in English

2 participants