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

refactor(i18n): restructure i18n system and add EN/CN translations #235

Closed
wants to merge 2 commits into from

Conversation

Crepveant
Copy link
Contributor

@Crepveant Crepveant commented Oct 22, 2024

  • Restructure i18n file organization into separate modules
  • Add English and Simplified Chinese translations for About/OpenData pages
  • Fix translation rendering issues in templates

- Restructure i18n file organization into separate modules
- Add English and Chinese translations for About/OpenData pages
- Fix translation rendering issues in templates
@Crepveant Crepveant requested a review from xicri as a code owner October 22, 2024 14:55
@CLAassistant
Copy link

CLAassistant commented Oct 22, 2024

CLA assistant check
All committers have signed the CLA.

Copy link
Owner

@xicri xicri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution!

Add English and Simplified Chinese translations for About/OpenData pages

This is very helpful! I have wanted to do it for long but postponed.

Did you translate it by yourself? (Without machine translators and generative AI such as ChatGPT?)

I'm asking this because machine translators often limit usage of the generated translation text. This dictionary is licensed under an opensoure license (Apache License 2.0), but I guess the vendor of machine translators doesn't allow licensing with Apache.

Genrative AI is also legally risky because the author of its training data might claim their rights to forbid usage of the generated contents by the future law amendment. (In Japan, the government already started discussion for the law amendment.)

pages/opendata.vue Outdated Show resolved Hide resolved
code: "en",
code: 'en',
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess your linter or editor accidentally violated the coding style. (Double quotes are replaced with single quotes, the trailing line breaks of the files are removed, missing trailing commas in the objects...)

Most of them can be automatically fixed with running npx eslint --fix on the project root.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, I just reminded that ESLint might fail to fix the coding style because this repository still uses old ESLint v8.

If ESLint doesn't work properly, you don't have to fix the coding style. I will fix it later.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I won’t be able to make these changes before 6 PM (UTC+8).
If it’s urgent, feel free to modify them.

Copy link
Owner

@xicri xicri Oct 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem, it is not an urgent task.
I often post comments in the early morning but feel free to reply after school or any time convenient for you.

(I hear that Japanese teens think they have to reply to the text chats as soon as possible, but is it the same in China? I usually reply after several hours or a day, so you don't have to try to reply immediately either.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe I’m one of the few exceptions allowed to use a phone at school

But obviously, I can’t bring my computer to school just for non-academic stuff lol

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most of them can be automatically fixed with running npx eslint --fix on the project root.

well it says

ESLint: 9.13.0

ESLint couldn't find an eslint.config.(js|mjs|cjs) file.

From ESLint v9.0.0, the default configuration file is now eslint.config.js.
If you are using a .eslintrc.* file, please follow the migration guide
to update your configuration file to the new format:

https://eslint.org/docs/latest/use/configure/migration-guide

If you still have problems after following the migration guide, please stop by
https://eslint.org/chat/help to chat with the team

should I commit directly or wait for you to make changes to ESLint🤔

@xicri
Copy link
Owner

xicri commented Oct 22, 2024

Ignore the error raised in GitHub Actions workflow vrt. Currently, it shouldn't run on PRs created by external contributors because it may expose API key for Cloudflare R3 (an object storage like Amazon S3 and Alibaba Object Storage Service).

@Crepveant
Copy link
Contributor Author

Did you translate it by yourself? (Without machine translators and generative AI such as ChatGPT?)

I used Google Translate to translate the Japanese text into Chinese for understanding, then rewrote it with my native Chinese knowledge.

The English version was grammar-checked using Youdao (possibly AI).

@xicri
Copy link
Owner

xicri commented Oct 23, 2024

I used Google Translate to translate the Japanese text into Chinese for understanding, then rewrote it with my native Chinese knowledge.

Hmm... then there are legal risks to merging your translations in this PR, unfortunately...
Can you remove the translations from this PR? (or you might want to create another PR)

The English version was grammar-checked using Youdao (possibly AI).

I guess grammar checkers are OK even if they use AI, if the base English texts themselves were translated by you.

When grammar checkers or human proofreaders correct grammatical errors, probably they all suggest mostly the same correction results based on the rule of grammar. I guess they are not protected by the copyrights.


Disclaimer for the other people who read this comment: I'm not a legal professional and THIS IS NOT A LEGAL ADVICE.

@Crepveant
Copy link
Contributor Author

Crepveant commented Oct 23, 2024

Hmm... then there are legal risks to merging your translations in this PR, unfortunately...

Can you remove the translations from this PR? (or you might want to create another PR)

No, I think you misunderstood.

I translated it into Chinese to understand the meaning because I don’t speak Japanese. As a native Chinese speaker, I didn’t use Google Translate text.

The English version was grammar-checked using Youdao (possibly AI).

I guess grammar checkers are OK even if they use AI, if the base English texts themselves were translated by you.

When grammar checkers or human proofreaders correct grammatical errors, probably they all suggest mostly the same correction results based on the rule of grammar. I guess they are not protected by the copyrights.

However, the English version is debatable (maybe...?) since I used an AI grammar correction tool.

@xicri
Copy link
Owner

xicri commented Oct 23, 2024

I translated it into Chinese to understand the meaning because I don’t speak Japanese. As a native Chinese speaker, I didn’t use Google Translate text.

Hmm... OK, but I think it is still a problem. Once you read the Chinese translation by Google Translate, some of your translations may be similar to Google's, and it is almost impossible to legally guarantee that your translations are not based on Google's, even if you didn't actually.

So I'm sorry to say, but I cannot accept your PR unless you remove the translated texts 🙏

However, the English version is debatable (maybe...?) since I used an AI grammar correction tool.

Since it is hard for us to expect how the lawmakers of each country make laws for Generative AI in the future, it might be a good idea to avoid such tools if it is not necessary.
I might add non-AI-based textlint if I have a chance.

@xicri
Copy link
Owner

xicri commented Oct 23, 2024

However, your code for i18n should be useful.
If you remove English and Chinese translation texts and create a separated PR, I think I can add English translations. Then a Chinese speaker (hopefully not you because it is a bit legally unsafe) can translate it to Chinese.

I'm considering to make /opendata page English only because it is updated a bit frequently and the target visitors of the page are the engineers.
So I think we can only translate /about page.

@Crepveant Crepveant closed this Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants