Class BaseTranslator
java.lang.Object
com.guflimc.brick.i18n.api.translator.BaseTranslator
- Direct Known Subclasses:
- ExtendedTranslator
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected final Localeprotected final Stringprotected final net.kyori.adventure.translation.TranslationRegistryprotected final StandardComponentRenderer
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionfinal net.kyori.adventure.text.Componentcenter(int width, net.kyori.adventure.text.Component component) final net.kyori.adventure.text.Componentcenter(net.kyori.adventure.text.Component component) final net.kyori.adventure.text.Componentfinal net.kyori.adventure.text.Componenthoverable(net.kyori.adventure.audience.Audience audience, @NotNull String msgKey, @NotNull String hoverKey) final Stringid()final voidimportTranslations(URL resource) final voidimportTranslations(URL resource, Locale locale) final voidimportTranslations(Path path) final net.kyori.adventure.text.ComponentmaybeTranslate(Locale locale, net.kyori.adventure.text.Component component) Translates the component if the given parameter is aTranslatableComponent.final net.kyori.adventure.text.ComponentmaybeTranslate(net.kyori.adventure.audience.Audience audience, net.kyori.adventure.text.Component component) final voidmenu(net.kyori.adventure.audience.Audience audience, char borderShape, net.kyori.adventure.text.format.TextColor borderColor, net.kyori.adventure.text.Component... components) final voidmenu(net.kyori.adventure.audience.Audience audience, net.kyori.adventure.text.Component... components) final net.kyori.adventure.text.ComponentpaddingAround(int width, net.kyori.adventure.text.Component... components) final net.kyori.adventure.text.ComponentpaddingAround(net.kyori.adventure.text.Component... components) final voidfinal voidfinal voidsend(net.kyori.adventure.audience.Audience audience, String key, net.kyori.adventure.text.Component... args) voidsend(net.kyori.adventure.audience.Audience audience, net.kyori.adventure.text.TranslatableComponent component) protected final net.kyori.adventure.text.TranslatableComponenttranslatable(String key, Object... args) protected final net.kyori.adventure.text.TranslatableComponenttranslatable(String key, net.kyori.adventure.text.Component... args) final net.kyori.adventure.text.Componentfinal net.kyori.adventure.text.Componentfinal net.kyori.adventure.text.Componentfinal net.kyori.adventure.text.Componentfinal net.kyori.adventure.text.Componenttranslate(Locale locale, Duration duration, DurationFormatter formatter) This will replace the following time placeholders with their respective translation: Y - time.year M - time.month D - time.day h - time.hour m - time.minute s - time.secondfinal net.kyori.adventure.text.Componentfinal net.kyori.adventure.text.Componentfinal net.kyori.adventure.text.Componentfinal net.kyori.adventure.text.Componenttranslate(net.kyori.adventure.audience.Audience audience, String key, net.kyori.adventure.text.Component... args) final net.kyori.adventure.text.Componentfinal net.kyori.adventure.text.Componenttranslate(net.kyori.adventure.audience.Audience audience, Duration duration, DurationFormatter formatter) final net.kyori.adventure.text.Componenttranslate(net.kyori.adventure.audience.Audience audience, net.kyori.adventure.text.TranslatableComponent component) final intwidth(net.kyori.adventure.text.Component component) 
- 
Field Details- 
registryprotected final net.kyori.adventure.translation.TranslationRegistry registry
- 
defaultLocale
- 
id
- 
renderer
 
- 
- 
Constructor Details- 
BaseTranslator
 
- 
- 
Method Details- 
id
- 
translatepublic final net.kyori.adventure.text.Component translate(Locale locale, net.kyori.adventure.text.TranslatableComponent component) 
- 
translate
- 
translate
- 
translate
- 
translatepublic final net.kyori.adventure.text.Component translate(net.kyori.adventure.audience.Audience audience, net.kyori.adventure.text.TranslatableComponent component) 
- 
translatepublic final net.kyori.adventure.text.Component translate(net.kyori.adventure.audience.Audience audience, String key) 
- 
translate
- 
translatepublic final net.kyori.adventure.text.Component translate(net.kyori.adventure.audience.Audience audience, String key, net.kyori.adventure.text.Component... args) 
- 
sendpublic void send(net.kyori.adventure.audience.Audience audience, net.kyori.adventure.text.TranslatableComponent component) 
- 
send
- 
send
- 
sendpublic final void send(net.kyori.adventure.audience.Audience audience, String key, net.kyori.adventure.text.Component... args) 
- 
translatable
- 
translatableprotected final net.kyori.adventure.text.TranslatableComponent translatable(String key, net.kyori.adventure.text.Component... args) 
- 
hoverable
- 
hoverable
- 
paddingAroundpublic final net.kyori.adventure.text.Component paddingAround(net.kyori.adventure.text.Component... components) 
- 
paddingAroundpublic final net.kyori.adventure.text.Component paddingAround(int width, net.kyori.adventure.text.Component... components) 
- 
centerpublic final net.kyori.adventure.text.Component center(net.kyori.adventure.text.Component component) 
- 
centerpublic final net.kyori.adventure.text.Component center(int width, net.kyori.adventure.text.Component component) 
- 
widthpublic final int width(net.kyori.adventure.text.Component component) 
- 
translatepublic final net.kyori.adventure.text.Component translate(Locale locale, Duration duration, DurationFormatter formatter) This will replace the following time placeholders with their respective translation:- Y - time.year
- M - time.month
- D - time.day
- h - time.hour
- m - time.minute
- s - time.second
 - Parameters:
- locale- the locale to use
- duration- the duration to format
- formatter- the formatter to use
- Returns:
- the translated and formatted duration
 
- 
translate
- 
translatepublic final net.kyori.adventure.text.Component translate(net.kyori.adventure.audience.Audience audience, Duration duration, DurationFormatter formatter) 
- 
translatepublic final net.kyori.adventure.text.Component translate(net.kyori.adventure.audience.Audience audience, Duration duration) 
- 
maybeTranslatepublic final net.kyori.adventure.text.Component maybeTranslate(Locale locale, net.kyori.adventure.text.Component component) Translates the component if the given parameter is aTranslatableComponent. Otherwise, this method will search the text of the given component and replace any keys that are found with its translation. It will then return the resulting component. If no keys are found, this will exactly return the given component.- Parameters:
- locale- the locale to use for translation
- component- the component to translate
- Returns:
- the translated component
 
- 
maybeTranslatepublic final net.kyori.adventure.text.Component maybeTranslate(net.kyori.adventure.audience.Audience audience, net.kyori.adventure.text.Component component) 
- 
importTranslations- Throws:
- MalformedURLException
 
- 
importTranslations
- 
importTranslations
 
-