Package com.marcpg.libpg.lang
Interface Translatable
public interface Translatable
Simple interface for making every translatable class organized into the same translation methods.
- Since:
- 0.0.6
-
Method Summary
Modifier and TypeMethodDescriptiondefault String
getSecondaryTranslated
(Locale locale) This is a secondary method to be used, if only one translation isn't enough.default net.kyori.adventure.text.Component
This is a secondary method to be used, if only one translation isn't enough.getTranslated
(Locale locale) Translates the class based on the given locale and outputs it as aString
representation.default net.kyori.adventure.text.Component
getTranslatedComponent
(Locale locale) Translates the class based on the given locale and outputs it as an adventure apiComponent
(TextComponent
) representation.
-
Method Details
-
getTranslated
Translates the class based on the given locale and outputs it as aString
representation.- Parameters:
locale
- The locale which will be translated to.- Returns:
- The translated result as a string.
-
getTranslatedComponent
Translates the class based on the given locale and outputs it as an adventure apiComponent
(TextComponent
) representation.- Parameters:
locale
- The locale which will be translated to.- Returns:
- The translated result as a string.
-
getSecondaryTranslated
This is a secondary method to be used, if only one translation isn't enough.
Translates the class based on the given locale and outputs it as aString
representation.- Parameters:
locale
- The locale which will be translated to.- Returns:
- The translated result as a string.
-
getSecondaryTranslatedComponent
This is a secondary method to be used, if only one translation isn't enough.
Translates the class based on the given locale and outputs it as an adventure apiComponent
(TextComponent
) representation.- Parameters:
locale
- The locale which will be translated to.- Returns:
- The translated result as a string.
-