Skip to content

fix: add note on DefaultI18NProvider available since 24.3 #3112

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

Merged
merged 6 commits into from
Jan 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion articles/advanced/i18n-localization.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,18 @@ description: Implementing localization and translation strings using I18NProvide
order: 20
---

= [since:com.vaadin:vaadin@V24.3]#Localization#

= Localization

To use localization and translation strings, the application needs only to have the translation properties available on the classpath under the directory, `vaadin-i18n` with the filename prefix, `translations` (e.g., `src/main/resources/vaadin-i18n/translations.properties`).

When using localization in an application, calling for a translation, or when the I18NProvider is used for the first time, the folder resource, `vaadin-i18n` is checked if it contains any `translations.properties` or `translations_[langcode].properties` files. Any language codes are collected from the available property files and added as provided locales in the [classname]`DefaultI18NProvider`.

The file `translations.properties` is a default translation file that'll be used for any [classname]`Locale` that doesn't have a specific translations file. Locale translation files are named, for example, like [filename]`translations_fi_FI.properties` or [filename]`translations_de.properties`. The automatic [classname]`Locale` creation supports from one to three parts (e.g., `translations_language_country_variant.properties`).

[NOTE]
[classname]`DefaultI18NProvider` is available as of version 24.3 of Vaadin Flow. For an earlier version, you'll need to implement your own [interfacename]`I18NProvider`, as documented in <<#defining-i18n-provider-property,Defining I18n Provider Property>> section.


== Locale Selection for New Session

Expand Down