Class GeyserLocale

java.lang.Object
org.geysermc.geyser.text.GeyserLocale

public class GeyserLocale extends Object
  • Constructor Details

    • GeyserLocale

      public GeyserLocale()
  • Method Details

    • loadGeyserLocale

      public static void loadGeyserLocale(String locale)
      Loads a Geyser locale from resources, if the file doesn't exist it just logs a warning
      Parameters:
      locale - Locale to load
    • getLocaleStringLog

      public static String getLocaleStringLog(String key, Object... values)
      Get a formatted language string with the default locale for Geyser
      Parameters:
      key - Language string to translate
      values - Values to put into the string
      Returns:
      Translated string or the original message if it was not found in the given locale
    • getPlayerLocaleString

      public static String getPlayerLocaleString(String key, String locale, Object... values)
      Get a formatted language string with the given locale for Geyser
      Parameters:
      key - Language string to translate
      locale - Locale to translate to
      values - Values to put into the string
      Returns:
      Translated string or the original message if it was not found in the given locale
    • formatLocale

      public static String formatLocale(String locale)
      Cleans up and formats a locale string
      Parameters:
      locale - The locale to format
      Returns:
      The formatted locale
    • getDefaultLocale

      public static String getDefaultLocale()
      Get the default locale that Geyser should use
      Returns:
      the current default locale
    • init

      public static void init()