package nckd.jxccl.hrmp.hbpm.common.hr;

import kd.bos.coderule.util.MultiLangEnumBridge;

/**
 * 多语言枚举
 * @author: jtd
 * @date: 2025/12/17 21:52
 */
public enum MultiLangEnum {
    CHINES_SIMP("zh_CN", new MultiLangEnumBridge("简体中文", "MultiLangEnum_0", "hrmp-haos-common")),
    CHINES_TRAD("zh_TW", new MultiLangEnumBridge("繁体中文", "MultiLangEnum_1", "hrmp-haos-common")),
    ENGLISH("en_US", new MultiLangEnumBridge("英文", "MultiLangEnum_2", "hrmp-haos-common"));

    private String code;
    private MultiLangEnumBridge bridge = null;

    private MultiLangEnum(String code, MultiLangEnumBridge bridge) {
        this.code = code;
        this.bridge = bridge;
    }

    public static String getName(String code) {
        if (code == null) {
            return null;
        } else {
            for(MultiLangEnum se : values()) {
                if (code.equals(se.getCode())) {
                    return se.getName();
                }
            }

            return null;
        }
    }

    public String getCode() {
        return this.code;
    }

    public String getName() {
        return this.bridge.loadKDString();
    }
}
