Module net.kyori.adventure.api
Package net.kyori.adventure.translation
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 net.kyori.adventure.translation.AbstractTranslationStore
AbstractTranslationStore.StringBased<T>Nested classes/interfaces inherited from interface net.kyori.adventure.translation.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 net.kyori.adventure.translation.AbstractTranslationStore
canTranslate, contains, contains, defaultLocale, equals, hasAnyTranslations, hashCode, name, register, registerAll, registerAll, toString, translationValue, unregisterMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.kyori.adventure.translation.TranslationStore
canTranslate, contains, contains, defaultLocale, register, registerAll, registerAll, unregisterMethods inherited from interface net.kyori.adventure.translation.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
Parses a string into the format required for this translation store.- Parameters:
string- the stringlocale- the locale for the string, if needed- Returns:
- the parsed type
- Since:
- 4.20.0
-
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
-