Class LanguageTranslator

java.lang.Object
uk.radialbog9.spigot.manhunt.language.LanguageTranslator

public class LanguageTranslator extends Object
Provides functions to translate language keys to the language configuration.
  • Constructor Details

    • LanguageTranslator

      public LanguageTranslator()
  • Method Details

    • translate

      public static String translate(@NotNull @NotNull String key, String... args)
      Gets the specified key from the language configuration then replaces {0}, {1}, etc with the arguments.
      Parameters:
      key - The language key
      args - The arguments
      Returns:
      String of language key with replacements or language key if the language request produces null
    • translate

      public static String translate(@NotNull @NotNull String key)
      Gets the specified key from the language configuration.
      Parameters:
      key - The language key
      Returns:
      String of language key or empty string if language key produces null