Interface Translator

    • Method Detail

      • parseLocale

        static @Nullable Locale parseLocale​(@NonNull String string)
        Parses a Locale from a String.
        Parameters:
        string - the string
        Returns:
        a locale
        Since:
        4.0.0
      • name

        @NonNull net.kyori.adventure.key.Key name()
        A key identifying this translation source.

        Intended to be used for display to users.

        Returns:
        an identifier for this translation source
        Since:
        4.0.0
      • translate

        @Nullable MessageFormat translate​(@NonNull String key,
                                          @NonNull Locale locale)
        Gets a message format from a key and locale.
        Parameters:
        locale - a locale
        key - a translation key
        Returns:
        a message format or null to skip translation
        Since:
        4.0.0