public class I18n
Localizes VoK messages such as exception messages, texts found in the filter components etc. To obtain instance of
this class, just use the vt property (provided both for Vaadin 8 and Vaadin 10)
which will lookup proper locale from the current UI. See the vt property documentation for more details.
The standard Java ResourceBundle mechanism is used.
The following resource bundles are searched:
The VokMessages*.properties bundle, located in the root package (src/main/resources/). Create one if you need to customize the localization
strings in your app.
If the message is not found, the standard message bundle of com.github.vok.VokMessages*.properties is consulted.
Consult the standard message bundle for the list of messages.
Currently there is no support for parameters nor expressions in the messages.
| Modifier and Type | Class and Description |
|---|---|
static class |
I18n.Companion |
| Modifier and Type | Field and Description |
|---|---|
static I18n.Companion |
Companion |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
get(java.lang.String key)
Retrieves the message stored under given key. If no such message exists, the function must not fail.
Instead, it should provide a key wrapped with indicators that a message is missing, for example
!{key}!. |
java.util.Locale |
getLocale()
the locale to use,
|
public static I18n.Companion Companion
public java.lang.String get(java.lang.String key)
Retrieves the message stored under given key. If no such message exists, the function must not fail.
Instead, it should provide a key wrapped with indicators that a message is missing, for example
!{key}!.
public java.util.Locale getLocale()
the locale to use,
not null.