-
Notifications
You must be signed in to change notification settings - Fork 235
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WebLaF messes up the Java Default Locale #457
Comments
This is a small feature integrated into You can disable it like this: LanguageManager.setUpdateLocale ( false ); Note that you need to do that strictly before installing L&F or initializing L&F managers, otherwise locale will be updated according to the language set in the manager. Though I do agree that |
Thank you a lot for prompt response, much appreciated.
On Fri, 2017-06-02 at 10:51 -0700, Mikle wrote:
This is a small feature integrated into LanguangeManager and enabled by default. Locale is being automatically set
according to the selected language - en by default which leads to en_GB locale.
You will have to manage quite a few locale/language pairs for English/French/German/Portuguese/Spanish that way, which
ends up mostly in identical translations. Why not honor the REGION/COUNTRY settings of the JDK?
You can disable it like this:
LanguageManager.setUpdateLocale ( false );
Awesome, this was what I was looking for!Suggestion: mention it perhaps in the basic howtos/instructions. The default
behavior is unexpected and hard to trace.
Though I do agree that Locale management is currently quite poor, so I'll mark this issue as an enhancement and will
look into that in the future updates.
Suggestion: set the language only, but do not alter the region/country and honor especially the JVM Options.
Thank you again for helping and best regardsAndreas
|
On Fri, 2017-06-02 at 10:51 -0700, Mikle wrote:
LanguageManager.setUpdateLocale ( false );
No wonder though that I did not find that: WebLAF 1.29 does not seem to have such a static public method in class
LanguageManager.
What version exactly is it referring to please?
Best regards
Andreas
|
I'm generally referencing latest styling branch snapshot builds as all other artifacts are a least a year+ older and contain a lot of issues which have already been fixed, so I strongly recommend using newer ones. You can find them on the snapshot maven repository: Also newer versions contain a lot of API changes and appropriate styling system implementation for the UI, so it is much more useful for anyone who would like to customize things. And yes, I know that versioning is in a mess right now (due to me trying to stick in too many things in one update), but I have to get through v1.2.9 release to manage all of the stuff properly in the future updates. |
There have been a similar question some time ago in #272 - I will certainly look into possible options when I will be working on |
This, unfortunately, won't always work as you would want to, so it's not a perfect solution either. But I will be looking into options when I will be working on the enhancements. |
I will make sure to add this this to wiki along with the other changes coming with this enhancements. |
Some major changes for You can read more about the upcoming changes here: |
`LanguageManager` was changed to allow requesting translations for multiple languages simultaneously and also to provide full support for any country codes. Big changes have also been made to features available within core `LanguageManager` and its UI counterpart - `WebLanguageManager`. Manger API was also slightly improved to reflect the changes. JUnit tests With this commit I have added first two JUnit tests for `LanguageManager` and `Merge` as the most intricate things within the library so far (not counting `StyleManager` but it will surely be covered later as well). I intend to add more tests in the future to cover most complicated library parts and make sure no major issues are going into any branches. Language - LanguageManager.java - Doesn't contain any UI-related code anymore, those have been moved into `WebLanguageManager` class - LanguageManager.java - Doesn't change locale according to provided language anymore [ #272 #457 ] - LanguageLocaleUpdater.java - `LanguageListener` implementation that can be used to auto-update default `Locale` with `LanguageManager` one - Language.java - New class providing access to translations based on `Locale` it stores, multiple instances provide access to multiple languages - LM.java - Reworked to provide convenient access to default `Language` instance or any other `Language` that is provided by customizable supplier - LanguageListener.java - Now only provides `Language` change event instead of being all-in-one listener - DictionaryListener.java - Now provides all `Dictionary`-related events instead of `LanguageListener` - LanguageConstants.java - Removed as redundant, all/supported locales can now be properly requested from `LanguageManager` - Dictionary.java - Removed `author`, `creationDate` and `notes` fields as redundant - Dictionary.java - Now contains all transient record and dictionary caches within itself - Dictionary.java - Renamed `languageInfos` into `translations` to reflect its actual meaning - Dictionary.java - Added methods to retrieve "all" and "fully supported" locales - TranslationInformation.java - Renamed from `LanguageInfo` and refactored - TranslationInformation.java - Language replaced with `locale` field to allow using country codes (ex. `en-GB` or `en-US`) - TranslationInformation.java - Removed `info` field as redundant - LanguageMethods.java - Now added to all existing Web-components as it can properly apply tooltip-only translations - JTextComponentLU.java - Now detects `IInputPrompt` interface usages in component or UI to provide translation for it - WebTextFieldLU.java, WebPasswordFieldLU.java, WebFormattedTextFieldLU.java - Removed as redundant - WebAbstractButtonLU.java - Removed as redundant, `AbstractButtonLU` fulfills its role now - WebLanguageUpdater.java - Removed as redundant as hotkeys are not supported by `LanguageManager` anymore - LanguageUpdaterSettings.java - Removed as a bad settings design, configuration remains within `JTabbedPaneLU` - LanguageSensitive.java - New marker interface created to assist UI components with detecting language-sensitive content - ListPainter.java, TreePainter.java, TablePainter.java - Updated to react to language-sensitive component, models, renderers and data - language.xml - Have been replaced with separate `core`, `ui` and `demo` XML dictionaries [ #470 ] - core-language.xml - New XML dictionary for `core` module - ui-language.xml - New XML dictionary for `ui` module - demo-language.xml - New XML dictionary for `demo` module - en_GB.png, en_US.png - New language variation icons LanguageChooser - LanguageChooser.java - New customizable language chooser based on supported `LanguageManager` locales - LanguageChooserModel.java - Provides a list of supported or predefined locales - languagechooser.xml - Separate light and dark styles for `LanguageChooser` HeatMap - HeatMap.java - New UI debugging tool that paints rendering time heat map over the UI Tree - TreeWalker.java - New interface providing options to conveniently iterate `JTree` nodes - AbstractTreeWalker.java - Abstract `TreeWalker` containing implementations for basic methods - SimpleTreeWalker.java - `TreeWalker` implementation for simple trees like `JTree`, `WebTree` and `WebExTree` - AsyncTreeWalker.java - `TreeWalker` implementation for `WebAsyncTree` that contains some workarounds - TreeUtils.java - Added method to retrieve `TreeWalker` implementation compatible with provided `JTree` Renderers - WebListCellRenderer.java, WebTreeCellRenderer.java, WebTableCellRenderer.java - Fixed performance issues for disabled icons - WebListCellRenderer.java, WebTreeCellRenderer.java - Added hover decoration state support Components - Added missing implementations for `ContainerMethods`, `EventMethods` and `ToolTipMethods` Style - StyleId.java, ComponentStyle.java - Expanded complete style identifier to avoid style caches overwriting each other - StyleManager.java, StyleData.java - Fixed a critical issue that might break skins loading order - MovingHighlightBackground.java - Added appropriate cleanup on deactivation, optimized and refactored code - MenuItemLayout.java - It is now more flexible and can be applied to any component, not just `JMenuItem` - RoundRectangle.java - Fixed preferred size calculation ComboBox - WebComboBoxModel.java - Replacement for default `DefaultComboBoxModel` with generic item type and additional methods - ComboBoxPainter.java - Removed redundant font and background updates from painting methods - WebComboBoxRenderer.java - Added new `pressed`, `expanded` and `collapsed` states for renderer component MenuItem - AbstractMenuItemLayout.java - Contains most of the code previously stored in `MenuItemLayout` - MenuItemLayout.java - Only includes `JMenuItem`-related features now - SimpleMenuItemLayout.java - New simplified menu item layout that is not tied to `JMenuItem` type and can be used separately DocumentPane - WebDocumentPane.java - Added "select" option for document open methods to allow choosing whether or not opened document tab should be selected - PaneData.java, ui-language.xml - Added "Close all" menu option for all tabs DateField - WebDateFieldUI.java - Added "Escape" hotkey for closing calendar popup Collection duplicate resolver - DuplicateResolver.java - Base interface for any class that detects and resolves duplicates within any `Collection` - AbstractDuplicateResolver.java - Abstract `DuplicateResolver` containing some basic methods for usage convenience - IgnoreDuplicates.java, RejectDuplicates.java, RemoveDuplicates.java - Basic `DuplicateResolver` implementations - DuplicateException.java - Special exception type used within `DuplicateResolver` implementations Object matcher - Matcher.java - Base interface for any kinds of object matchers - AbstractMatcher.java - Abstract `Matcher` that uses generic types for matched objects - EqualMatcher.java, IdentifiableMatcher.java, SkippingMatcher.java - Basic `Matcher` implementations Merge - ListMergeBehavior.java - Have been greatly improved and made configurable with `Matcher` and `DuplicateResolver` usage - IndexListMergeBehavior.java - New simple list elements merge behavior for index-to-index merge - Overwriting.java - Now implements `Mergeable` by default - RelativeTypeMergePolicy.java - Renamed from `RelatedTypeMergePolicy` for convenience - Mergeable.java, GlobalMergeBehavior.java - Minor JavaDoc improvements Clone - Clone.java - Added minor improvement to allow `Clone` to set final values API - BiPredicate.java - `BiPredicate` from JDK8 for later porting convenience DemoApplication - DemoApplication.java - Added `HeatMap` tool - Updated multiple classes according to code changes LibraryInfoDialog - LibraryInfoDialog.java - Refactored and cleaned up code, moved styles into extension - LibraryInfoExtension.java, LibraryInfoIconSet.java - Extension and icon set for `LibraryInfoDialog` - info-extension.xml, info-icons.xml, java.svg - Resources for `LibraryInfoDialog` Utilities - ImmutableSet.java - New unmodifiable `Set` implementation - IconUtils.java - New utility class providing methods for various icon manipulations - FileUtils.java - Added method to filter out unwanted symbols from text for file name - ArrayUtils.java - Added methods to compare arrays - CollectionUtils.java - Added method to retrieve maximum element from collection according to comparator Project - pom.xml - Updated to include JUnit library as test dependency - build.properties - Updated path to `LibraryInfoDialog` - Added currently used JUnit library version and its dependencies
Changes are now available in LanguageManager.addLanguageListener ( new LanguageLocaleUpdater () ); |
OS
JDK/Java:
Now, the issue is: while the language English seems to be correct, Date and Number formats are messed up completely by that. Enforcing en_US is also not an option for an software, which supports various languages. Accepting en_GB does not work either, as any other component (Database, Reports, Spreadsheets) will correctly parse/format according to en_US.
We would like to suggest to not temper with the frameworks settings as it breaks things too easily and is difficult to trace.
The text was updated successfully, but these errors were encountered: