Interface TranslationStore.StringBased<T>

Type Parameters:
T - the type of the translation
All Superinterfaces:
TranslationStore<T>, Translator
All Known Subinterfaces:
TranslationRegistry
All Known Implementing Classes:
AbstractTranslationStore.StringBased
Enclosing interface:
TranslationStore<T>

public static interface TranslationStore.StringBased<T> extends TranslationStore<T>
An abstract, string-based translation store.

This class extends upon the standard abstract translation store by adding support for reading from resource bundles.

Since:
4.20.0
  • Method Details

    • registerAll

      void registerAll(@NotNull @NotNull Locale locale, @NotNull @NotNull Path path, boolean escapeSingleQuotes)
      Registers a resource bundle of translations.
      Parameters:
      locale - a locale
      path - a path to the resource bundle
      escapeSingleQuotes - whether to escape single quotes
      Throws:
      IllegalArgumentException - if a translation key already exists
      Since:
      4.20.0
      See Also:
    • registerAll

      void registerAll(@NotNull @NotNull Locale locale, @NotNull @NotNull ResourceBundle bundle, boolean escapeSingleQuotes)
      Registers a resource bundle of translations.

      It is highly recommended to create your bundle using UTF8ResourceBundleControl as your bundle control for UTF-8 support - for example:

      
         final TranslationStore store = ...;
         final ResourceBundle bundle = ResourceBundle.getBundle("my_bundle", Locale.GERMANY, UTF8ResourceBundleControl.get());
         store.registerAll(Locale.GERMANY, bundle, false);
       
      Parameters:
      locale - a locale
      bundle - a resource bundle
      escapeSingleQuotes - whether to escape single quotes
      Throws:
      IllegalArgumentException - if a translation key already exists
      Since:
      4.20.0
      See Also: