Class LanguageManager


  • public class LanguageManager
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      LanguageManager()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static LanguageFile getLanguageFile​(org.bukkit.plugin.java.JavaPlugin plugin)
      Gets the language file of the plugin.
      static java.lang.String getPrimary()
      Gets the primary language code.
      static java.lang.String getSecondary()
      Gets the secondary language code.
      static void updateTextsYaml​(org.bukkit.plugin.java.JavaPlugin plugin, java.lang.String resourcePath)
      Updates the texts.yml file in the config folder.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • LanguageManager

        public LanguageManager()
    • Method Detail

      • getLanguageFile

        public static LanguageFile getLanguageFile​(org.bukkit.plugin.java.JavaPlugin plugin)
        Gets the language file of the plugin. Every plugin has only one language file, and it is located in plugin_data_folder/config/texts.yml
        Parameters:
        plugin - The plugin whose language file you want to get.
        Returns:
        The language file of the specified plugin.
      • getPrimary

        public static java.lang.String getPrimary()
        Gets the primary language code.
        Returns:
        Primary language code.
      • getSecondary

        public static java.lang.String getSecondary()
        Gets the secondary language code. (usually eng)
        Returns:
        The secondary language code.
      • updateTextsYaml

        public static void updateTextsYaml​(org.bukkit.plugin.java.JavaPlugin plugin,
                                           java.lang.String resourcePath)
        Updates the texts.yml file in the config folder. It essentially copies all key-value pairs read from the file provided by resourcePath.
        Parameters:
        plugin - Your JavaPlugin instance.
        resourcePath - The text file's path within the .jar file.