Interface Translator

  • All Known Implementing Classes:
    Context, LocalizationService
    Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    @FunctionalInterface
    public interface Translator
    A class implementing this interface is able to translate strings.
    • Method Detail

      • translate

        default String translate​(String bundle,
                                 String key,
                                 Object... args)
        Translates a string.
        Parameters:
        bundle - the name of the bundle where to find the strings
        key - the key identifying the string
        args - the arguments of the string, if any
        Returns:
        the translated string
      • getLocale

        Locale getLocale()
        Gets the locale used by this translator.
        Returns:
        the locale