Closed zx900930 closed 4 years ago
@RaphaelDDL In nuxt-i18n the language code is code of ISO 639-1 and code of ISO 3166-1 alpha-2, with a hyphen.(ex: 'en-US') so it should be 'zh-TW' & 'zh-CN' instead of 'zht' & 'zhs'.
I mean, for the code
@ https://github.com/EpicSevenDB/ui/blob/master/lang/config.js
So for example:
{
name: "普通话",
code: "cn",
iso: "zh-CN",
file: "zh-CN.js",
countries: ["China"],
},
From what we discussed previously, the current zh-CN will become zh-TW (zht) and the new zh-CN (zhs) will be the one you translated.
name
is what appears on the lang list;iso
is the one added to the html, like <html lang="en-US"
.countries
is the array for the flag image names (my custom thing)file
is the filename to load fromcode
is what will become the epicsevendb.com/{lang}/, e.g. epicsevendb.com/cn/ right now.So I was thinking in having it changed to be epicsevendb.com/zht/
and epicsevendb.com/zhs/
, where I need to make some kind of handler that if anyone access epicsevendb.com/cn/*
it'll 301 redirect to epicsevendb.com/zhs/
, without htat, any /cn/
will go into 404.
EDIT:
Or should I just keep zh-TW as /tw/
and zh-CN as /cn/
? What you think it's better; tw/cn or zht/zhs in the url?
Keeping tw/cn would be easier since cn
would only now point to a newly created zh-CN instead of current zh-CN (which is actually a zh-TW)
@RaphaelDDL Keeping tw/cn in the url is better in this case.
@zx900930 Okay, I've incorporated opencc
that you suggested into my build script
Can you please confirm if was done correctly? I see some kanjis changed so I guess it worked.
zht
{
"ef101_desc": "蘊含光明之力的神秘之劍,能持續注入活力。",
"ef101_name": "太陽之劍",
"sk_ef101_de": "攻擊力增加{{variable}}。",
"ef102_desc": "傳說被那把槍射中的人一定會受到詛咒。",
"ef102_name": "惡魔手槍",
"sk_ef102_de": "暴擊率增加{{variable}}。",
"ef103_desc": "說說看你想做什麼樣的夢吧!我會讓你看見一切夢想。",
"ef103_name": "夢之卷軸",
"sk_ef103_de": "效果抗性增加{{variable}}。",
"ef104_desc": "以風一般的速度飛走,攻擊敵人要害的飛鏢。",
"ef104_name": "寒風飛鏢",
"sk_ef104_de": "暴擊傷害增加{{variable}}。",
"ef105_desc": "若擁有這顆寶珠,金星的祝福便會與你同在。",
"ef105_name": "金星寶珠",
"sk_ef105_de": "效果命中增加{{variable}}。",
"ef106_desc": "用一般攻擊不會碎裂的特殊強化拳套",
"ef106_name": "強化拳套",
"sk_ef106_de": "防禦力增加{{variable}}。",
"ef201_desc": "那把劍一旦從劍鞘出鞘,就一定得奪走一條人命,否則死的就會是你。",
"ef201_name": "必殺大劍",
converted zhs:
{
"ef101_desc": "蕴含光明之力的神秘之剑,能持续注入活力。",
"ef101_name": "太阳之剑",
"sk_ef101_de": "攻击力增加{{variable}}。",
"ef102_desc": "传说被那把枪射中的人一定会受到诅咒。",
"ef102_name": "恶魔手枪",
"sk_ef102_de": "暴击率增加{{variable}}。",
"ef103_desc": "说说看你想做什么样的梦吧!我会让你看见一切梦想。",
"ef103_name": "梦之卷轴",
"sk_ef103_de": "效果抗性增加{{variable}}。",
"ef104_desc": "以风一般的速度飞走,攻击敌人要害的飞镖。",
"ef104_name": "寒风飞镖",
"sk_ef104_de": "暴击伤害增加{{variable}}。",
"ef105_desc": "若拥有这颗宝珠,金星的祝福便会与你同在。",
"ef105_name": "金星宝珠",
"sk_ef105_de": "效果命中增加{{variable}}。",
"ef106_desc": "用一般攻击不会碎裂的特殊强化拳套",
"ef106_name": "强化拳套",
"sk_ef106_de": "防御力增加{{variable}}。",
"ef201_desc": "那把剑一旦从剑鞘出鞘,就一定得夺走一条人命,否则死的就会是你。",
"ef201_name": "必杀大剑",
Relevant commits: https://github.com/EpicSevenDB/gamedatabase/commit/4dad4873dd4ccb54f2aab9a23085d35ab2d23ebd https://github.com/EpicSevenDB/api/commit/177f821b9c1f11c31c60d5fbb68bafd96e6a9165
Now to do the changes in EpicSevenDB/ui itself
last relevant change https://github.com/EpicSevenDB/ui/commit/2cbbeeed699731587c5c153d26b15b2fa52a208b
Let me know if it's all good and I'll put it in prod
@RaphaelDDL I'll fix some minor translation issues and send a PR.
changes 1. rename lang/{zh-TW.js => zh-CN.js} rename lang/{zh-CN.js => zh-TW.js}
2.minor translation fix.
see : https://github.com/EpicSevenDB/ui/pull/35/
suggestion:
/lang/config.js
{ name: "简体中文", code: "cn", iso: "zh-CN", file: "zh-CN.js", countries: ["China","Singapore"], }, { name: "繁體中文", code: "tw", iso: "zh-TW", file: "zh-TW.js", countries: ["Taiwan","Hong-Kong","Macau"], },
Add the counties or regions using Chinese and add the flags to https://assets.epicsevendb.com/website/flags/
Great, thank you.
For the suggestion, I don't think the flag pack I got has HK or Macau, so I'll have to edit it myself, but it's cool.
@zx900930 Just a follow up on this, I still haven't put into prod as I still haven't found a way of redirecting anyone from
/cn/
into the new/zht/
. Right now, trying to access a /cn will give 404 pages when I switch to zht on url path, so that will hit SEO.So, i'm looking into how add a custom handler to nuxt-i18n to handle these changes.
When I did change from
/kr
to/ko
, it was a nightmare SEO-wise since all indexed /kr became 404's and hurt SEO pretty bad