Class AbstractTranslationStore.StringBased<T>
java.lang.Object
net.kyori.adventure.translation.AbstractTranslationStore<T>
net.kyori.adventure.translation.AbstractTranslationStore.StringBased<T>
- Type Parameters:
T- the type of the translation
- All Implemented Interfaces:
TranslationStore<T>, TranslationStore.StringBased<T>, Translator
- Enclosing class:
AbstractTranslationStore<T>
public abstract static class AbstractTranslationStore.StringBased<T>
extends AbstractTranslationStore<T>
implements TranslationStore.StringBased<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
-
Nested Class Summary
Nested classes/interfaces inherited from class AbstractTranslationStore
AbstractTranslationStore.StringBased<T>Nested classes/interfaces inherited from interface TranslationStore
TranslationStore.StringBased<T> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedStringBased(Key name) Creates a new abstract, string-based translation store with a given name. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract TParses a string into the format required for this translation store.final voidregisterAll(Locale locale, Path path, boolean escapeSingleQuotes) Registers a resource bundle of translations.final voidregisterAll(Locale locale, ResourceBundle bundle, boolean escapeSingleQuotes) Registers a resource bundle of translations.Methods inherited from class AbstractTranslationStore
canTranslate, contains, contains, defaultLocale, equals, hasAnyTranslations, hashCode, name, register, registerAll, registerAll, toString, translationValue, unregisterMethods inherited from interface TranslationStore
canTranslate, contains, contains, defaultLocale, register, registerAll, registerAll, unregisterMethods inherited from interface Translator
hasAnyTranslations, name, translate, translate
-
Constructor Details
-
StringBased
Creates a new abstract, string-based translation store with a given name.- Parameters:
name- the name- Since:
- 4.20.0
-
-
Method Details
-
parse
-
registerAll
Description copied from interface:TranslationStore.StringBasedRegisters a resource bundle of translations.- Specified by:
registerAllin interfaceTranslationStore.StringBased<T>- Parameters:
locale- a localepath- a path to the resource bundleescapeSingleQuotes- whether to escape single quotes- See Also:
-
registerAll
Description copied from interface:TranslationStore.StringBasedRegisters a resource bundle of translations.- Specified by:
registerAllin interfaceTranslationStore.StringBased<T>- Parameters:
locale- a localebundle- a resource bundleescapeSingleQuotes- whether to escape single quotes
-