using System.Collections.Generic;
using UnityEngine;

namespace NBC
{
    public struct LanguageInfo
    {
        public SystemLanguage Language;
        public string Name;
        public string Code;
    }

    public class LanguageConst
    {
        public const string LanguageSaveKey = "LanguageSaveKey";

        //简体中文、繁体中文、英语、日语、韩语、泰语、越南语、法语、德语、葡萄牙与、西班牙语、俄语、波兰语、荷兰语、
        
        
        //简体中文、繁体中文、英语、日语、德语、俄语、法语、西班牙语、韩语、葡萄牙
        
        //土耳其语、意大利语、印度尼西亚语，阿拉伯语，泰语、越南语、波兰语、荷兰语
        
        public static readonly List<LanguageInfo> LanguageList = new List<LanguageInfo>()
        {
            new LanguageInfo() { Language = SystemLanguage.English, Name = "English", Code = "en" },
            new LanguageInfo() { Language = SystemLanguage.ChineseSimplified, Name = "简体中文", Code = "zh-CN" },
            new LanguageInfo() { Language = SystemLanguage.ChineseTraditional, Name = "繁體中文", Code = "zh-TW" },
            // new LanguageInfo() { Language = SystemLanguage.Japanese, Name = "日本語", Code = "ja" },
            // new LanguageInfo() { Language = SystemLanguage.French, Name = "Français", Code = "fr" },
            // new LanguageInfo() { Language = SystemLanguage.German, Name = "Deutsch", Code = "de" },
            // new LanguageInfo() { Language = SystemLanguage.Korean, Name = "한국어", Code = "ko" },
            // new LanguageInfo() { Language = SystemLanguage.Russian, Name = "Русский", Code = "ru" },
            // new LanguageInfo() { Language = SystemLanguage.Spanish, Name = "Español", Code = "es" },
            // new LanguageInfo() { Language = SystemLanguage.Portuguese, Name = "Português", Code = "pt" },
            
            // new LanguageInfo() { Language = SystemLanguage.Polish, Name = "Polski", Code = "pl" },
            // new LanguageInfo() { Language = SystemLanguage.Dutch, Name = "Nederlands", Code = "nl" },
            // new LanguageInfo() { Language = SystemLanguage.Turkish, Name = "Türkçe", Code = "tr" },
            // new LanguageInfo() { Language = SystemLanguage.Italian, Name = "Italiano", Code = "it" },
            // new LanguageInfo() { Language = SystemLanguage.Arabic, Name = "العربية", Code = "ar" }
            // new LanguageInfo() { Language = SystemLanguage.Vietnamese, Name = "Tiếng Việt", Code = "vi" },
            // new LanguageInfo() { Language = SystemLanguage.Thai, Name = "ไทย", Code = "th" },
            // new LanguageInfo() { Language = SystemLanguage.Indonesian, Name = "Bahasa Indonesia", Code = "id" },
        };

        /// <summary>
        /// 自定义语言和名字映射关系
        /// </summary>
        public static readonly Dictionary<SystemLanguage, LanguageInfo> languageMap =
            new Dictionary<SystemLanguage, LanguageInfo>();

        static LanguageConst()
        {
            languageMap.Clear();
            foreach (var languageInfo in LanguageList)
            {
                languageMap.Add(languageInfo.Language, languageInfo);
            }
        }
    }
}