Package 

Class I18n


  • 
    public final 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 14) 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.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      public class Companion
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private final Locale locale
    • Method Summary

      Modifier and Type Method Description
      final String get(String key) Retrieves the message stored under given key.
      final Boolean contains(String key) Checks whether there is a message under given key.
      final Locale getLocale()
      • Methods inherited from class eu.vaadinonkotlin.I18n

        equals, hashCode, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • get

         final String get(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}!.

      • contains

         final Boolean contains(String key)

        Checks whether there is a message under given key. If not, get will return !{key}!.