You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
DefaultI18NProvider falls back to the JVM default locale before the base bundle #26383
DefaultI18NProvider.getBundle calls ResourceBundle.getBundle(BUNDLE_PREFIX, locale, classLoader) with the default ResourceBundle.Control. When there is no translations_<locale>.properties for the requested locale, that control tries the JVM's default locale before it falls back to the base translations.properties.
Example: an application with translations.properties (English) and translations_de.properties, running on a server whose default locale is de_DE. An English user (en_US) gets the German texts, because translations_de is found through the JVM default before the base file is reached. An application can only avoid this by adding an empty translations_en_US.properties for every supported locale.
Suggested: load the bundles with ResourceBundle.Control.getNoFallbackControl(ResourceBundle.Control.FORMAT_PROPERTIES), so a missing locale goes straight to the base file.
DefaultI18NProvider.getBundle calls ResourceBundle.getBundle(BUNDLE_PREFIX, locale, classLoader), which uses the default ResourceBundle.Control. Its getFallbackLocale returns Locale.getDefault(), so when no bundle matches the requested locale (or its language), the JVM default locale's bundle is tried before the base translations.properties. The result therefore depends on the server's locale setting: with translations_de.properties on a de_DE server, an en_US user gets German. The existing unit test even documented this ("default translations.properties will be used if the locale AND system default locale is not found") and only passed because the build JVM's default locale had no bundle.
Fix: as suggested, load bundles with ResourceBundle.Control.getNoFallbackControl(ResourceBundle.Control.FORMAT_PROPERTIES). Candidate lookup for the requested locale is unchanged (de_AT → de → base), only the JVM-default step is removed. DefaultInstantiator creates the default provider only when translation files exist, and the case "only locale bundles, none matching" still returns the key, as before.
Note on behaviour: an app that relied on the JVM default locale's bundle being used for unknown locales will now get the base bundle instead. That old result depended on the server's environment, so this seems the right default.
Draft PR with a regression test (fails before, passes after): #26387
Activity
totally-not-ai commentedon Oct 13, 2026
Triage: confirmed bug.
DefaultI18NProvider.getBundlecallsResourceBundle.getBundle(BUNDLE_PREFIX, locale, classLoader), which uses the defaultResourceBundle.Control. ItsgetFallbackLocalereturnsLocale.getDefault(), so when no bundle matches the requested locale (or its language), the JVM default locale's bundle is tried before the basetranslations.properties. The result therefore depends on the server's locale setting: withtranslations_de.propertieson ade_DEserver, anen_USuser gets German. The existing unit test even documented this ("default translations.properties will be used if the locale AND system default locale is not found") and only passed because the build JVM's default locale had no bundle.Fix: as suggested, load bundles with
ResourceBundle.Control.getNoFallbackControl(ResourceBundle.Control.FORMAT_PROPERTIES). Candidate lookup for the requested locale is unchanged (de_AT→de→ base), only the JVM-default step is removed.DefaultInstantiatorcreates the default provider only when translation files exist, and the case "only locale bundles, none matching" still returns the key, as before.Note on behaviour: an app that relied on the JVM default locale's bundle being used for unknown locales will now get the base bundle instead. That old result depended on the server's environment, so this seems the right default.
Draft PR with a regression test (fails before, passes after): #26387
fix(i18n): drop the empty en_US bundle now that Flow has no fallback (#…
fix: skip JVM default locale when loading translation bundles (vaadin…
vaadin-bot commentedon Oct 22, 2026
This ticket/PR has been released with Vaadin 25.4.0-alpha4.