Class Translation

java.lang.Object
com.palmergames.bukkit.towny.object.Translation

public final class Translation extends Object
A convenience object to facilitate translation.
  • Method Details

    • loadTranslationRegistry

      public static void loadTranslationRegistry()
    • of

      public static String of(String key)
      Translates given key into the default Locale.
      Parameters:
      key - The language key.
      Returns:
      The localized string.
    • of

      public static String of(String key, Object... args)
      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

      public static String of(String key, Locale locale)
      Translates given key into the given locale.
      Parameters:
      key - The language key.
      locale - Locale to translate to.
      Returns:
      The localized string.
    • of

      public static String of(String key, Locale locale, Object... args)
      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

      public static String of(String key, org.bukkit.command.CommandSender sender)
    • of

      public static String of(String key, org.bukkit.command.CommandSender sender, Object... args)
    • of

      public static String of(String key, Resident resident)
    • of

      public static String of(String key, Resident resident, Object... args)
    • toLocale

      public static Locale toLocale(String fileName, boolean shouldWarn)
    • setDefaultLocale

      protected static void setDefaultLocale()
    • getDefaultLocale

      public static Locale 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

      public static Locale getLocale(org.bukkit.command.CommandSender sender)
    • getLocaleOffline

      public static Locale getLocaleOffline(@NotNull @NotNull org.bukkit.OfflinePlayer offlinePlayer)
    • getLocale

      public static Locale getLocale(Resident resident)
    • addTranslations

      public static void addTranslations(Map<String,Map<String,String>> addedTranslations)
    • hasTranslation

      public static boolean hasTranslation(@NotNull @NotNull String key, @NotNull @NotNull Locale locale)
      Parameters:
      key - The key to check for
      locale - The language
      Returns:
      Whether the language has a translation for the given key
      Since:
      0.99.5.20