Repository navigation
Numbers and dates in the user's language, not the browser's - #239
Merged
Merged
Conversation
The front end formatted with the browser's locale: a German browser showed the graveyard's "1.055GB" (1,055 GB) next to the curator's "3,152 GB". Both follow one language now, the one the user writes to the curator in most (services/user_language over wrapup_writer.main_language: stopwords, no model, English without messages, read once an hour per user). The login and /api/auth/status carry it as "locale" (en-US, de-DE, ...); setUser hands it to ui.setLocale, and every toLocaleString / toLocaleDateString / toLocaleTimeString call (81 in 14 files) passes ui.loc(). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
What & why
The front end formatted numbers and dates with the browser's locale. On a German browser the Wrap-Up's graveyard read "1.055GB" (meaning 1,055 GB), right next to the curator's "3,152 GB". The owner asked for both to follow the language the user speaks to Curatarr in.
services/user_language.py: the language the user writes to the curator in most.wrapup_writer.main_language: stopwords over the last 300 messages, no model).en-US,de-DE,fr-FR, …)./api/auth/statuscarry it aslocale.ui.setLocale/ui.loc():setUsersets it before anything renders. EverytoLocaleString/toLocaleDateString/toLocaleTimeStringcall (81 in 14 files) now passesloc().loc()isundefined, so the browser's own locale is used, as before.Checks
python tests/run_all.pyis green (252/252)tests/test_user_locale.py(8 checks):toLocale*call left withoutloc();setUserorder;de-DE1.055 vsen-US1,055.test_wrapup_story_mode's node harness stubsloc.🤖 Generated with Claude Code