Package net.hectus.lang
Class Translatable
java.lang.Object
net.hectus.lang.Translatable
Easy abstract class for making every translatable class organized into the same translation methods.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract String
getTranslated
(Locale locale) Translates the class based on the user's locale and outputs it as aString
representation.net.kyori.adventure.text.Component
getTranslatedComponent
(Locale locale) Translated the class based on the user's locale and outputs it as a adventure apiComponent
.
-
Constructor Details
-
Translatable
public Translatable()
-
-
Method Details
-
getTranslated
Translates the class based on the user's locale and outputs it as aString
representation.- Parameters:
locale
- The user's locale which will be translated to.- Returns:
- The translated result as a string.
-
getTranslatedComponent
Translated the class based on the user's locale and outputs it as a adventure apiComponent
.- Parameters:
locale
- The user's locale which will be translated to.- Returns:
- The translated result as a component.
-