diff --git a/messages/zh.json b/messages/zh.json new file mode 100644 index 0000000..25d39c1 --- /dev/null +++ b/messages/zh.json @@ -0,0 +1,75 @@ +{ + "TabTitle": { + "title": "Firefly 分析器", + "description": "Veritas 分析工具" + }, + "DataAnalysisPage": { + "useSkill": "使用技能", + "totalDamage": "总伤害", + "damagePerAV": "每行动值伤害", + "totalAV": "总行动值", + "damagerPerCycle": "每轮伤害", + "skillType": "技能类型", + "skillName": "技能名称", + "actionValue": "行动值", + "character": "角色", + "id": "ID", + "path": "命途", + "rarity": "稀有度", + "damageByActionValue": "此行动值的伤害", + "element": "属性", + "totalTurn": "总轮次", + "technique": "密技", + "talent": "天赋", + "basic": "普攻", + "skill": "战技", + "ultimate": "终结技", + "servant": "忆灵", + "skillDamageBreakdown": "技能伤害细分", + "skillUsageDistribution": "技能使用分布", + "damageOverTime": "累计伤害", + "damage": "伤害", + "cumulativeDamage": "累计伤害量", + "characterInformation": "角色信息", + "turnDetail": "轮次详情", + "damageDetails": "伤害详情", + "cycleCount": "轮次", + "chartInfo": "图表信息", + "actionBar": "行动轴", + "lineupInfo": "阵容信息", + "loadData": "加载战斗数据", + "exportData": "导出战斗数据", + "connectSetting": "连接设置", + "connected": "已连接", + "unconnected": "未连接", + "socketConnection": "socket连接", + "connectionType": "连接类型", + "status": "状态", + "connect": "连接", + "checkGameConnect": "检查游戏连接", + "other": "其他", + "host": "主机", + "port": "端口", + "hostPlaceHolder": "输入主机地址", + "portPlaceHolder": "输入端口号", + "noDamageDetail": "没有可用的伤害详情", + "noCharactersInLineup": "队伍中没有角色", + "noTurns": "尚未有回合", + "style": "风格", + "warrior": "毁灭", + "knight": "存护", + "mage": "智识", + "priest": "丰饶", + "rouge": "巡猎", + "shaman": "同协", + "warlock": "虚无", + "memory": "记忆", + "fire": "火", + "ice": "冰", + "imaginary": "虚数", + "physical": "物理", + "quantum": "量子", + "thunder": "雷", + "wind": "风" + } +} diff --git a/src/components/header/index.tsx b/src/components/header/index.tsx index 32e7d6f..d1c2d39 100644 --- a/src/components/header/index.tsx +++ b/src/components/header/index.tsx @@ -46,7 +46,11 @@ export default function Header() { if (cookieLocale) { setLocale(cookieLocale) } else { - const browserLocale = navigator.language.slice(0, 2); + let browserLocale = navigator.language.slice(0, 2); + const listCurrentLanguage = ["jp", "kr", "en", "vi", "zh", "cn"] + if(!listCurrentLanguage.includes(browserLocale)) { + browserLocale = "en" + } setLocale(browserLocale); document.cookie = `MYNEXTAPP_LOCALE=${browserLocale};` router.refresh()