FastGPT icon indicating copy to clipboard operation
FastGPT copied to clipboard

Added English Version

Open NextThread opened this issue 1 year ago • 9 comments

#160 Added English version

NextThread avatar Aug 17 '23 19:08 NextThread

  • You cann't use useTranslation in not-hook pages.
  • For these api files, you only need to return English and use useTranslation to translate after FE receives English.

I suggest you try to translate this file first: client/src/pages/account/index.tsx

Finally, for t(""), you need to fill in the string in English, not Chinese, and the Chinese translation should be placed in client/public/locales/zh/common.json, the English translation in client/public/locales/en/common.json.

For example: 登出

You should write: t('account.Log out'), and add translate json:

client/public/locales/zh/common.json

{
....
account: {
   Log out: "登出"
}
...
}

client/public/locales/en/common.json

{
....
account: {
   Log out: "Log out"
}
...
}
``

c121914yu avatar Aug 19 '23 06:08 c121914yu

https://github.com/labring/FastGPT/pull/188/files#diff-a230fda8fcaeb65e8d9d6c6a7e46be5ab91f3b77f8fbd27bf477f7130b24457c

https://github.com/labring/FastGPT/pull/188/files#diff-1765c82f6dd349c4a5efe6884d44b21f0f0bdfd864fab200ced0bb2bd0f722cf

https://github.com/labring/FastGPT/pull/188/files#diff-f8c980e5d5a5fd5b2fcf72dfcb59b7041d3362cd80409341b8f19ab3851b7d25

tried to translate this file: client/src/pages/account/index.tsx

am I on the wrong path again? please confirm

NextThread avatar Aug 19 '23 19:08 NextThread

https://github.com/labring/FastGPT/pull/188/files#diff-a230fda8fcaeb65e8d9d6c6a7e46be5ab91f3b77f8fbd27bf477f7130b24457c

https://github.com/labring/FastGPT/pull/188/files#diff-1765c82f6dd349c4a5efe6884d44b21f0f0bdfd864fab200ced0bb2bd0f722cf

https://github.com/labring/FastGPT/pull/188/files#diff-f8c980e5d5a5fd5b2fcf72dfcb59b7041d3362cd80409341b8f19ab3851b7d25

tried to translate this file: client/src/pages/account/index.tsx

am I on the wrong path again? please confirm

@c121914yu

NextThread avatar Aug 25 '23 14:08 NextThread

https://github.com/labring/FastGPT/pull/188/files#diff-a230fda8fcaeb65e8d9d6c6a7e46be5ab91f3b77f8fbd27bf477f7130b24457c https://github.com/labring/FastGPT/pull/188/files#diff-1765c82f6dd349c4a5efe6884d44b21f0f0bdfd864fab200ced0bb2bd0f722cf https://github.com/labring/FastGPT/pull/188/files#diff-f8c980e5d5a5fd5b2fcf72dfcb59b7041d3362cd80409341b8f19ab3851b7d25 尝试翻译此文件:client/src/pages/account/index.tsx 难道我又走错路了?请确认

@c121914yu

yes.

  1. You need to write English in t(), not Chinese.
  2. You need to add the corresponding translation in local.
  3. You can install vscode's “I18n Ally” plugin to assist with translation.

I mean, you can try to modify the file: client/src/pages/account/index, so that I can help you to correct. This pr is too big for me to comment on one by one

c121914yu avatar Aug 26 '23 17:08 c121914yu

@c121914yu

Screenshot 2023-08-27 at 12 27 06 AM
  1. Added the English inside t()
Screenshot 2023-08-27 at 12 28 33 AM
  1. Added the corresponding in common.json

NextThread avatar Aug 26 '23 18:08 NextThread

@c121914yu

Screenshot 2023-08-27 at 12 27 06 AM
  1. Added the English inside t()
Screenshot 2023-08-27 at 12 28 33 AM
  1. Added the corresponding in common.json

yes! We recommend that translations add prefixes by module.

example: Confirm to log out > account.Confirm to log out.

Prefixes are roughly divided: account, app, chat, kb, common

c121914yu avatar Aug 30 '23 00:08 c121914yu

@c121914yu

Screenshot 2023-08-27 at 12 27 06 AM
  1. Added the English inside t()
Screenshot 2023-08-27 at 12 28 33 AM
  1. Added the corresponding in common.json

and please fetch and rebase latest code

c121914yu avatar Aug 30 '23 00:08 c121914yu

Hi @c121914yu , I did the required changes, please review it

NextThread avatar Aug 30 '23 06:08 NextThread

You need to pull the latest code and resolve conflicts first, and I recommend committing a small amount of code first. And I gave some code comment.

There are too many modified files, it is not convenient for me to merge after correction, please submit fewer files for the first time.

c121914yu avatar Sep 01 '23 16:09 c121914yu