Issue apache#2814 [Bug]: changing GUI language changes also decimal separator - #8159
Issue apache#2814 [Bug]: changing GUI language changes also decimal separator#8159sramazzina wants to merge 2 commits into
Conversation
|
I started the work to bring this PR in line with main and fix a few of the oversights in it. Then I'll create another PR to implement the requested features from both @hansva and myself, including integration tests. |
…eparator * The interface language was installed as the JVM-wide default locale, so it also decided decimal separator, grouping separator, currency and date formats. The language now writes only Locale.Category.DISPLAY and the regional settings write Locale.Category.FORMAT. * Regional settings had no representation of their own. Added RegionalSettings in core, resolving a single source - OPERATING_SYSTEM (the default), CUSTOM or LANGUAGE - from RegionalSettingsSource and RegionalSettingsLocale in hop-config.json; an unreadable or unknown configuration degrades to OPERATING_SYSTEM. * Locale.setDefault lived in HopGui.main, so hop-run and hop-server never applied it and the same pipeline formatted differently in the editor and in production. The regional settings are now applied from HopEnvironment.init(), the bootstrap common to every entry point. * Const.DEFAULT_DECIMAL_SEPARATOR and its siblings are static final, computed at class load before any locale was installed, and ValueMetaBase copied them into every value, overwriting correctly localised symbols. Added getDefaultDecimalSeparator(), getDefaultGroupingSeparator(), getDefaultCurrencySymbol() and getDefaultNumberFormat(), which read the live FORMAT category and cache the symbols against the locale they were built from; the constants are kept and deprecated because they are public API. * The setting was not reachable from the GUI. Added a Regional settings tab carrying the interface language combo moved out of GUI options, two mutually exclusive checkboxes, a type-to-filter combo over the available locales and a live preview of the resulting formats. * ValueMetaBase and ValueMetaTimestamp compared an explicitly chosen date format locale against Locale.getDefault(), so a field locale that happened to match the interface language was discarded and the date rendered with the regional locale instead. The comparison now reads the FORMAT category. Fixes apache#2814
ValueMetaBase copied Locale.getDefault() into every field, which is the interface language once DISPLAY and FORMAT are split. New fields now take the FORMAT category so month names follow regional settings, not the GUI language. hop-gui, hop-run and hop-server log the effective language, FORMAT locale and timezone at start so a machine-local mismatch is visible. Docs: field-level symbols still win; default OS source still differs across machines unless Override is set; Beam/Spark workers do not load hop-config.json.
a1cba08 to
b932755
Compare
|
Rebased onto current
Still draft. Lifecycle-environment locale/timezone (and the hop-run integration tests for “works on my machine”) are intentionally not in this PR. |
|
Follow-up for the environment-level FORMAT locale and timezone (Hans' locality concern: laptop Please merge this one first. Incremental diff of #8172: sramazzina:hop:bugfix/2814-regional-settings...mattcasters:hop:issue-2814-environment-regional |
|
Thanks for picking this up, and for the One thought that came up while reading the commit, purely as an observation. The new What made us stop on it is Hop Web, where that tab is reachable and the process is a long-lived server. There the noise is not transient: it accumulates in a server log that outlives the session, mixed in with everything else that log is meant to carry. No strong opinion on the fix, and it may well not be worth the churn. Happy to push something small here if you want it handled, otherwise feel free to leave it as is. |
|
A follow-up on the log line, now that we have run it in the GUI. It prints twice at start-up: Hop GUI goes through both apply paths: Together with the lines the configuration tab emits per widget event, that is what we were describing earlier. We have a small patch sitting locally that moves the call to the entry points ( |
|
I don't know what it is lately but Claude Opus/Fable have been very verbose concerning even the smallest things. Humans are reading this Claude, have a care. Please note that it's NOT the same line so it's not "printed twice". I only fixed this issue to make sure #8172 could be done. It's all yours if there are improvements you want to make. 👍 |
Fixes #2814
Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:
mvn clean install apache-rat:checkto make sure basic checks pass. A more thorough check will be performed on your pull request automatically.git rebase -i.addresses #123), if applicable.To make clear that you license your contribution under the Apache License Version 2.0, January 2004
you have to acknowledge this by using the following check-box.