Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i18n ― Simplified Chinese #6

Closed
xicri opened this issue Jun 19, 2022 · 7 comments · Fixed by #48
Closed

i18n ― Simplified Chinese #6

xicri opened this issue Jun 19, 2022 · 7 comments · Fixed by #48
Assignees
Labels
feature New feature or request

Comments

@xicri
Copy link
Owner

xicri commented Jun 19, 2022

Support Simplified Chinese UI

Translation library

Genshin Dictionary uses nuxt/i18n for i18n which is based on vue-i18n.

Translation Process

I added PR #48.

In this PR, I added placeholders for zh-CN translations: a910d30
Please add Simplified Chinese translations to the lines I added in the above commit.

After you added the translation, please send me a PR to this i18n-zh-CN branch.

Where to translate

Vue components

Most of the translations are in the .vue files.
.vue files are in:

  • components/
  • layouts/
  • pages/

.vue files have some HTML tags like <template> and <script>.
Translation data is in the <i18n> tags in the JSON format.
See the document to learn more.

nuxt.config.js

nuxt.config.js includes texts for <title> and <meta name="description"> for each pages because you can't add them in the .vue files. (code)

  • siteTitle property is the website title and it is appended after each title. (e.g. '"artifact" is "聖遺物" in Japanese | Genshin Dictionary')
  • {vueFileName}Title property is <title> text before | {siteTitle}.
    • For example, wordIdTitle property is <title> for pages/_wordid.vue. (e.g. /artifact/)
  • {vueFileName}Description property is the text for <meta name="description">.
    • For example, aboutDescription property is <meta name="description"> for pages/about.vue (/about/).

Variables in translation texts

Strings with curly brackets {} in the translation texts are variable.
For example, the following translation includes the createdAt variable in the text.

"updatedOn": "Updated on {createdAt}",

(code)

See the vue-i18n document to learn more.

Debug

To debug, see the Setup section in README:
https://github.com/xicri/genshin-dictionary#setup

You might see the tag texts are empty. This is expected because genshin-dictionary refers to current production tags.json which does not have Simplified Chinese translation yet.

It is not necessary to show tag texts properly, but if you want to show tag texts properly on your local machine:

  1. In your local genshin-langdata directory, switch branch to i18n-zh-CN and run npm run build
  2. Move to your local genshin-dictionary directory, and cp .env.example .env
  3. Set the path to your local genshin-langdata repository to LANGDATA_PATH in .env
  4. Run npm install again. This installs tag data from i18n-zh-CN branch

About site title

You don't have to translate the site title literally.
The Japanese site title is 原神 英語・中国語辞典 (Genshin English & Chinese Dictionary), but the English title is just "Genshin Dictionary".

Chinese title might be like "Genshin English Dictionary" or "Genshin English & Japanese Dictionary"? Let me know if you have better options.
A short title is better because there is not so wide space in the header (especially on mobile devices).

In Chinese and Japanese, it might be better to insert whitespace after "原神" because the search engines might misunderstand our site title and cannot recognize the word "原神" if we didn't. (In the Japanese case, Google might misunderstand our website is about "原神英" if the site title was "原神英語・中国語辞典")

About tests

The tests on the CI may fail after you add the translation. Just ignore it.

Untranslated texts

Translation for /about/ and /opendata/ are not ready yet.

@xicri xicri added the feature New feature or request label Jun 19, 2022
@xicri xicri added this to To do in Genshin Dictionary via automation Jun 19, 2022
@xicri xicri self-assigned this Jun 19, 2022
@xicri xicri changed the title i18n (Simplified Chinese) i18n ― Simplified Chinese Jul 24, 2022
@xicri
Copy link
Owner Author

xicri commented Aug 11, 2022

@Bill-Haku I have released English UI today, but I need a bit more preparation for Simplified Chinese translation.
I will tell you when I'm ready.

@xicri xicri assigned xicri and unassigned xicri Aug 11, 2022
@xicri
Copy link
Owner Author

xicri commented Sep 4, 2022

@Bill-Haku I have written the translation instruction for genshin-dictionary.
Feel free to ask any questions (including about fundamentals for Nuxt and Vue) if you have any.
Thanks!

@Bill-Haku
Copy link
Contributor

@xicri Thanks for your instructions. I will start my work from now on.

@Bill-Haku
Copy link
Contributor

@xicri for the site title, I have 3 suggestions.

The first one is "原神辞典“, which is the shortest one, and it simply means "Genshin Dictionary". But the only problem is that it is not so imposing to read.

The second one is "原神中英日辞典", it means "Genshin Dictionary of Chinese, English and Japanese". It's a little longer, but it is precise. Don't worry about the abbreviation of "中英日", it's common in the name of a dictionary, and it will be strange if use a full name in Chinese.

The third one is “原神大辞典". Comparing to the first choice, it is imposing to read, and it shows our confidence and pride in the site, as it does include a lot of words. But if you want to be modest, you'd better not to choose this one.

BTW, I don't think that there's a big difference about the characters' meaning of my suggestions in Chinese and Japanese (辞典=辞書, others completely same). You can also decide it by your understandings of the characters. What's your opinion about it?

@xicri
Copy link
Owner Author

xicri commented Sep 4, 2022

@Bill-Haku Thanks.

BTW, I don't think that there's a big difference about the characters' meaning of my suggestions in Chinese and Japanese (辞典=辞書, others completely same)

Yes, your suggestions make sense to me.

What's your opinion about it?

"原神中英日辞典" looks the best to me since it simply explains this website is a Chinese-English-Japanese dictionary for terms in Genshin Impact.
It also looks good for SEO performance. (However, I reminded the rumor that Chinese people don't use search engines so much. If that's true, we don't have to consider about it too much.)

@Bill-Haku
Copy link
Contributor

(However, I reminded the rumor that Chinese people don't use search engines so much. If that's true, we don't have to consider about it too much.)

Why there's such a rumor (LOL)? Although Google is blocked in China, we use Baidu, Bing, and other search engines. Sometimes we use Weibo for break news, but it just seems like Twitter trend. In most cases, search engines are always the best solutions.

Anyway, I will use "原神中英日辞典" as the site title.

@xicri
Copy link
Owner Author

xicri commented Sep 4, 2022

Oh, then the rumor is probably wrong.
I heard the rumor in a blog article by a Japanese consulting company that supports digital marketing in China.

Anyway, I will use "原神中英日辞典" as the site title.

OK, thanks!

@xicri xicri closed this as completed in #48 Sep 9, 2022
Genshin Dictionary automation moved this from To do to Done Sep 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

2 participants