Skip to content

#2126: Fix language selection drop down - #2234

Merged
hohwille merged 6 commits into
devonfw:mainfrom
oanding-blrng:fix/2126-fix-only-german-is-listed-in-language-selection-dropdown-2
Jul 31, 2026
Merged

#2126: Fix language selection drop down#2234
hohwille merged 6 commits into
devonfw:mainfrom
oanding-blrng:fix/2126-fix-only-german-is-listed-in-language-selection-dropdown-2

Conversation

@oanding-blrng

@oanding-blrng oanding-blrng commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

This PR fixes #2126

Identification of root cause:

In the current setup of property files for localization, the method

private ResourceBundle loadBundle(Locale locale) {
return ResourceBundle.getBundle(BUNDLE_NAME, locale);
}
returns the German ResourceBundle instead of the English one (located in the root properties file) with Locale.ENGLISH as an argument. This leads to a list with only one entry for the language selection dropdown, because for both locals (en and de) the German ResourceBundle gets returned.

This behaviour is "normal" in the sense, that ResourceBundle first tries to find a properties file for en_UK, can't find one and goes up the chain for en and after that the root file. But before the root is being used, ResourceBundle also tries the system locale (for me this would return de_DE). So ResourceBundle would search for de_DE, and after that de. Because of this "missing link" in the chain for English, this results in the observed behaviour mentioned in the issue #2126. Additional information are in #2221.

Implemented changes:

  • Created messages_en.properties, so the ResourceBundle can find the correct bundle and fallbacks automatically for the keys to the root properties, because no keys are being overwritten
  • Extended testGetInstanceWithLocale(..) test method in NlsServiceTest.java to cover additional machine setups

Testing instructions

Please add concise, understandable instructions on how a reviewer can test/verify the functionality of your contribution here:

  1. Run the test of the GUI module with mvn test -pl gui. The tests mentioned in the issue only german is listed in language selection dropdown #2126 should pass now
  2. Run the AppLauncher via RunConfiguration
  3. Depending on the locale settings of the machine, the language should either be the system setting or English for the start
  4. German and English are both listed in the dropdown menu and selecting a different language should take effect in the GUI

Retest:

  1. Run ide gui. The language selection dropdown should now list English and German

Checklist for this PR

Make sure everything is checked before merging this PR. For further info please also see
our DoD.

  • When running mvn clean test locally all tests pass and build is successful
  • PR title is of the form #«issue-id»: «brief summary» (e.g. #921: fixed setup.bat). If no issue ID exists, title only.
  • PR top-level comment summarizes what has been done and contains link to addressed issue(s)
  • PR and issue(s) have suitable labels
  • Issue is set to In Progress and assigned to you or there is no issue (might happen for very small PRs)
  • You followed all coding conventions
  • You have added the issue implemented by your PR in CHANGELOG.adoc unless issue is labeled
    with internal
  • You have formulated clear instructions on how to test your contribution under "Testing instructions"

… property files for i18n. Extend testGetInstanceWithLocale() test method to inculde additional test cases. Added ticket to the CHANGELOG.adoc.
@github-project-automation github-project-automation Bot moved this to 🆕 New in IDEasy board Jul 29, 2026
@oanding-blrng oanding-blrng self-assigned this Jul 29, 2026
@oanding-blrng oanding-blrng moved this from 🆕 New to 🏗 In progress in IDEasy board Jul 29, 2026
@oanding-blrng oanding-blrng added GUI Graphical User Interface of IDEasy (aka dashboard) build with JavaFx bugfix PR that fixes a bug issue labels Jul 29, 2026
@oanding-blrng
oanding-blrng marked this pull request as ready for review July 29, 2026 14:03

@hohwille hohwille left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@oanding-blrng thanks for this PR with your new approach. Looks great to me👍
I only have some rather cosmetic remarks before we will merge.

Comment thread gui/src/test/java/com/devonfw/ide/gui/nls/NlsServiceTest.java Outdated
Comment thread gui/src/test/java/com/devonfw/ide/gui/nls/NlsServiceTest.java Outdated
@github-project-automation github-project-automation Bot moved this from 🏗 In progress to 👀 In review in IDEasy board Jul 30, 2026
* Modified NlsService.java to localize display label to service locale (e.g. serviceLocale=de, label=Deutsch (de) and serviceLocale=en, label=German (de)).
* Removed language key CurrentLanguage in messages bundle
* Updated test method testGetInstanceWithLocale() to only test fields of service class.
* Extended test method testLanguageDisplayShowsLocaleName() to parameterized test to cover additional machine setups and proper display of langage labels.
…man-is-listed-in-language-selection-dropdown-2

# Conflicts:
#	CHANGELOG.adoc
#	gui/src/test/java/com/devonfw/ide/gui/nls/NlsServiceTest.java
@coveralls

Copy link
Copy Markdown
Collaborator

Coverage Report for CI Build 30614172600

Coverage increased (+0.04%) to 72.676%

Details

  • Coverage increased (+0.04%) from the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • 18 coverage regressions across 1 file.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

18 previously-covered lines in 1 file lost coverage.

File Lines Losing Coverage Coverage
com/devonfw/ide/gui/nls/NlsService.java 18 82.01%

Coverage Stats

Coverage Status
Relevant Lines: 17274
Covered Lines: 13087
Line Coverage: 75.76%
Relevant Branches: 7649
Covered Branches: 5026
Branch Coverage: 65.71%
Branches in Coverage %: Yes
Coverage Strength: 3.21 hits per line

💛 - Coveralls

@hohwille hohwille added this to the release:2026.08.001 milestone Jul 31, 2026
@hohwille
hohwille merged commit b00955d into devonfw:main Jul 31, 2026
4 checks passed
@github-project-automation github-project-automation Bot moved this from 👀 In review to ✅ Done in IDEasy board Jul 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix PR that fixes a bug issue GUI Graphical User Interface of IDEasy (aka dashboard) build with JavaFx

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

only german is listed in language selection dropdown

3 participants