package cc.util.bossshop.filemanager;

import org.bukkit.ChatColor;

import cc.util.bossshop.pluginmodel.ABukkitPlugin;

public abstract class ALangManager extends AFileManager{
    
    public ALangManager(ABukkitPlugin pPlugin,String pFileName,String pVersion){
        super(pPlugin,pFileName,pVersion);
    }
    
    /**
     * 获取指定消息节点的翻译,大小写敏感
     * @param pNode 消息节点名
     * @return 翻译后的消息
     */
    public String getNode(String pNode){
        String tMsg=this.mConfig.getString(pNode);
        if(tMsg!=null) return ChatColor.translateAlternateColorCodes('&',tMsg);
        else{
            this.mPlugin.warn("missing language node ["+pNode+"]");
            this.mPlugin.warn("丢失语言节点 ["+pNode+"]");
            return pNode;
        }
    }
    
}
