Class Translation
java.lang.Object
com.palmergames.bukkit.towny.object.Translation
A convenience object to facilitate translation.
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
static Locale
static Locale
static Locale
getLocale
(org.bukkit.command.CommandSender sender) static Locale
getLocaleOffline
(@NotNull org.bukkit.OfflinePlayer offlinePlayer) static boolean
hasTranslation
(@NotNull String key, @NotNull Locale locale) static void
static String
Translates given key into the default Locale.static String
static String
static String
Translates given key into the default Locale.static String
Translates given key into the given locale.static String
Translates given key into the given locale.static String
static String
protected static void
static Locale
static String
translateTranslatables
(org.bukkit.command.CommandSender sender, Translatable... translatables) static String
translateTranslatables
(org.bukkit.command.CommandSender sender, String delimiter, Translatable... translatables)
-
Method Details
-
loadTranslationRegistry
public static void loadTranslationRegistry() -
of
Translates given key into the default Locale.- Parameters:
key
- The language key.- Returns:
- The localized string.
-
of
Translates given key into the default Locale.- Parameters:
key
- The language key.args
- The arguments to format the localized string.- Returns:
- The localized string.
-
of
Translates given key into the given locale.- Parameters:
key
- The language key.locale
- Locale to translate to.- Returns:
- The localized string.
-
of
Translates given key into the given locale.- Parameters:
key
- The language key.locale
- Locale to translate to.args
- The arguments to format the localized string.- Returns:
- The localized string.
-
of
-
of
-
of
-
of
-
toLocale
-
setDefaultLocale
protected static void setDefaultLocale() -
getDefaultLocale
-
translateTranslatables
public static String translateTranslatables(org.bukkit.command.CommandSender sender, Translatable... translatables) -
translateTranslatables
public static String translateTranslatables(org.bukkit.command.CommandSender sender, String delimiter, Translatable... translatables) -
getLocale
-
getLocaleOffline
-
getLocale
-
addTranslations
-
hasTranslation
- Parameters:
key
- The key to check forlocale
- The language- Returns:
- Whether the language has a translation for the given key
- Since:
- 0.99.5.20
-