Repository navigation
Conversation
- EN/RO switch in the home top bar and in Settings; the choice is a ws_lang
cookie, so it's known at page load and sent with every request (D15).
- Frontend: static/js/i18n.js with a Romanian dictionary keyed by the English
text (~300 strings). Static and dynamically inserted text is translated
automatically by a MutationObserver; strings with variables use t(). News,
LLM output and chat are marked no-i18n. Numbers, money and dates are
locale-aware (fmtN, Intl with ro-RO).
- Backend: watchstock/i18n.py (tr, num) and a middleware that sets the
request language. Score breakdowns, labels and flags, Today events (with
Romanian dates), portfolio flags, warnings and errors are localised.
Scores are now computed at serve time, so a language switch applies to
cached snapshots. The LLM is told to write in Romanian.
- tests/test_i18n.py enforces complete dictionaries (backend tr() literals,
frontend t() calls, every string in index.html) and matching placeholders.
The UI smoke test audits Romanian pages for leftover English. It caught a
MutationObserver infinite loop on identical translations ("P/E") and the
logo turning into "WatchAcțiune".
- CLAUDE.md: translation rules for future changes.
109 backend tests.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TW7cJeWrcBW5SJHr4ZKtSH
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.
Stacked on #6.
English / Romanian (D15)
ws_langcookie, and switching reloads the page.static/js/i18n.jsholds a dictionary keyed by the English text.t().no-i18n).watchstock/i18n.py(tr,num), with a middleware that sets the request language.tests/test_i18n.pyfails if any string is missing a translation.109 backend tests.
Generated by Claude Code