Package net.kyori.adventure.translation
Interface GlobalTranslator
- All Superinterfaces:
- net.kyori.examination.Examinable,- Translator
public interface GlobalTranslator extends Translator, net.kyori.examination.Examinable
A global source of translations.
- Since:
- 4.0.0
- 
Method SummaryModifier and Type Method Description booleanaddSource(@NonNull Translator source)Adds a translation source.static @NonNull GlobalTranslatorget()Gets the global translation source.booleanremoveSource(@NonNull Translator source)Removes a translation source.static @NonNull Componentrender(@NonNull Component component, @NonNull Locale locale)Renders a component using theglobal renderer.static @NonNull TranslatableComponentRenderer<Locale>renderer()Gets a renderer which uses the global source for translating.@NonNull Iterable<? extends Translator>sources()Gets the sources.
- 
Method Details- 
getGets the global translation source.- Returns:
- the source
- Since:
- 4.0.0
 
- 
rendererGets a renderer which uses the global source for translating.- Returns:
- a renderer
- Since:
- 4.0.0
 
- 
renderRenders a component using theglobal renderer.- Parameters:
- component- the component to render
- locale- the locale to use when rendering
- Returns:
- the rendered component
- Since:
- 4.0.0
 
- 
sources@NonNull Iterable<? extends Translator> sources()Gets the sources.- Returns:
- the sources
- Since:
- 4.0.0
 
- 
addSourceAdds a translation source.Duplicate sources will be ignored. - Parameters:
- source- the source
- Returns:
- trueif registered,- falseotherwise
- Throws:
- IllegalArgumentException- if source is- GlobalTranslator
- Since:
- 4.0.0
 
- 
removeSourceRemoves a translation source.- Parameters:
- source- the source to unregister
- Returns:
- trueif unregistered,- falseotherwise
- Since:
- 4.0.0
 
 
-