Interface TranslationSource

All Known Subinterfaces:
BundleTranslationSource, TranslationSourceRegistry

public interface TranslationSource
A helper class for adding translations to your plugin.
  • Method Details

    • router

      static TranslationSource router()
      Returns a TranslationSource for the router language :^).
    • getTranslation

      @Nullable Translation getTranslation(String key, Locale locale)
      Returns a translation for the given key or null if absent.
      Parameters:
      key - the key
      Returns:
      the translation, or null if no suitable translation was found.
    • getTranslationOrDefault

      default Translation getTranslationOrDefault(String key, Locale locale, Function<String,Translation> fallback)
      Returns a translation for the given key or a default translation if absent.
      Parameters:
      key - the key
      locale - the locale
      fallback - the fallback translation
      Returns:
      the translation
    • getTranslationOrMissing

      default Translation getTranslationOrMissing(String key, Locale locale)
      Returns a translation for the given key or a missing translation if absent.
      Parameters:
      key - the key
      locale - the locale
      Returns:
      the translation