diff --git a/README.md b/README.md
index cc1a555..181d830 100644
--- a/README.md
+++ b/README.md
@@ -112,9 +112,13 @@ At `ChatGPTFreeApp`, we strive to provide you with useful and amazing features a
If you have enjoyed using our app, we kindly ask you to give this project a ⭐️. Your endorsement means a lot to us and encourages us to work harder towards delivering the best possible experience.
-If you would like to support the team, consider buying us a coffee by clicking on the button below. Every contribution, no matter how small, helps us to maintain and improve our service.
+If you would like to support the team, consider sponsoring us through one of the methods below. Every contribution, no matter how small, helps us to maintain and improve our service.
-[![support](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/freechatgpt)
+| Payment Method | Link |
+| -------------- | -------------------------------------------------------------------------------------- |
+| KoFi | [![support](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/freechatgpt) |
+| Alipay (Ayaka) | |
+| Wechat (Ayaka) | |
Thank you for being a part of our community, and we look forward to serving you better in the future.
diff --git a/package.json b/package.json
index 5afa853..bc99f34 100644
--- a/package.json
+++ b/package.json
@@ -10,9 +10,13 @@
},
"dependencies": {
"html2canvas": "^1.4.1",
+ "i18next": "^22.4.11",
+ "i18next-browser-languagedetector": "^7.0.1",
+ "i18next-http-backend": "^2.1.1",
"jspdf": "^2.5.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
+ "react-i18next": "^12.2.0",
"react-markdown": "^8.0.5",
"react-scroll-to-bottom": "^4.2.0",
"rehype-highlight": "^6.0.0",
diff --git a/public/locales/en/about.json b/public/locales/en/about.json
new file mode 100644
index 0000000..4d9d745
--- /dev/null
+++ b/public/locales/en/about.json
@@ -0,0 +1,22 @@
+{
+ "description": "Free ChatGPT is an amazing open-source web app that allows you to play with OpenAI's ChatGPT API for free!",
+ "discordServer": {
+ "title": "Discord Server",
+ "paragraph1": "We invite you to join our Discord community! Our Discord server is a great place to exchange ChatGPT ideas and tips, and submit feature requests for Free ChatGPT. You'll have the opportunity to interact with the developers behind Free ChatGPT as well as other AI enthusiasts who share your passion.",
+ "paragraph2": "To join our server, simply click on the following link: <0>https://discord.gg/g3Qnwy4V6A0>. We can't wait to see you there!"
+ },
+ "privacyStatement": {
+ "title": "Privacy Statement",
+ "paragraph1": "We highly value your privacy and are committed to safeguarding the privacy of our users. We do not collect or store any text you enter or receive from the OpenAI server in any form. Our source code is available for your inspection to verify this statement.",
+ "paragraph2": "We prioritise the security of your API key and handle it with utmost care. If you use your own API key, your key is exclusively stored on your browser and never shared with any third-party entity. It is solely used for the intended purpose of accessing the OpenAI API and not for any other unauthorised use."
+ },
+ "support": {
+ "title": "Support",
+ "paragraph1": "At Free ChatGPT, we strive to provide you with useful and amazing features around the clock. And just like any project, your support and motivation will be instrumental in helping us keep moving forward!",
+ "paragraph2": "If you have enjoyed using our app, we kindly ask you to give this <0>project0> a ⭐️. Your endorsement means a lot to us and encourages us to work harder towards delivering the best possible experience.",
+ "paragraph3": "If you would like to support the team, consider sponsoring us through one of the methods below. Every contribution, no matter how small, helps us to maintain and improve our service.",
+ "paragraph4": "Thank you for being a part of our community, and we look forward to serving you better in the future.",
+ "alipay": "Alipay",
+ "wechatPay": "WeChat Pay"
+ }
+}
diff --git a/public/locales/en/api.json b/public/locales/en/api.json
new file mode 100644
index 0000000..778757c
--- /dev/null
+++ b/public/locales/en/api.json
@@ -0,0 +1,13 @@
+{
+ "securityMessage": "We prioritise the security of your API key and handle it with utmost care. Your key is exclusively stored on your browser and never shared with any third-party entity. It is solely used for the intended purpose of accessing the OpenAI API and not for any other unauthorised use.",
+ "apiEndpoint": {
+ "option": "Use free API endpoint",
+ "inputLabel": "Free API Endpoint",
+ "description": "Use free API endpoint from <0>Ayaka0>: https://chatgpt-api.shn.hk/v1/ or enter your own API endpoint"
+ },
+ "apiKey": {
+ "option": "Use your own API key",
+ "howTo": "Get your personal API key <0>here0>",
+ "inputLabel": "API Key"
+ }
+}
diff --git a/public/locales/en/main.json b/public/locales/en/main.json
new file mode 100644
index 0000000..6c47095
--- /dev/null
+++ b/public/locales/en/main.json
@@ -0,0 +1,25 @@
+{
+ "save": "Save",
+ "saveAndSubmit": "Save & Submit",
+ "cancel": "Cancel",
+ "confirm": "Confirm",
+ "warning": "Warning",
+ "clearMessageWarning": "Please be advised that by submitting this message, all subsequent messages will be deleted!",
+ "clearConversationWarning": "Please be advised that by confirming this action, all messages will be deleted!",
+ "clearConversation": "Clear Conversation",
+ "import": "Import",
+ "export": "Export",
+ "author": "Made by Jing Hua",
+ "about": "About",
+ "api": "API",
+ "personal": "Personal",
+ "free": "Free",
+ "downloadChat": "Download Chat",
+ "user": "User",
+ "assistant": "Assistant",
+ "system": "System",
+ "newChat": "New Chat",
+ "lightMode": "Light Mode",
+ "darkMode": "Dark Mode",
+ "setting": "Settings"
+}
diff --git a/public/locales/en/model.json b/public/locales/en/model.json
new file mode 100644
index 0000000..2dd3d04
--- /dev/null
+++ b/public/locales/en/model.json
@@ -0,0 +1,13 @@
+{
+ "configuration": "Configuration",
+ "model": "Model",
+ "default": "Default",
+ "temperature": {
+ "label": "Temperature",
+ "description": "What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic (Default: 1)"
+ },
+ "presencePenalty": {
+ "label": "Presence Penalty",
+ "description": "Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics. (Default: 0)"
+ }
+}
diff --git a/public/locales/zh-CN/about.json b/public/locales/zh-CN/about.json
new file mode 100644
index 0000000..e4993e9
--- /dev/null
+++ b/public/locales/zh-CN/about.json
@@ -0,0 +1,22 @@
+{
+ "description": "Free ChatGPT 是一个神奇的开源 Web 应用,允许您免费使用 OpenAI 的 ChatGPT API 进行对话!",
+ "discordServer": {
+ "title": "Discord 服务器",
+ "paragraph1": "我们邀请您加入我们的 Discord 社区!我们的 Discord 服务器是一个很好的地方,可以交流 ChatGPT 的想法和技巧,并提交 Free ChatGPT 的功能请求。您将有机会与 Free ChatGPT 的开发人员以及其他分享您热情的人工智能爱好者互动。",
+ "paragraph2": "要加入我们的服务器,只需单击以下链接:<0>https://discord.gg/g3Qnwy4V6A0>。我们迫不及待地想见到您!"
+ },
+ "privacyStatement": {
+ "title": "隐私声明",
+ "paragraph1": "我们非常重视您的隐私,并致力于保护用户的隐私。我们不会以任何形式收集或存储您输入或从 OpenAI 服务器接收的任何文本。我们的源代码可以供您检查,以验证此声明。",
+ "paragraph2": "我们高度优先考虑您的 API 密钥的安全,并非常小心地处理它。如果您使用自己的 API 密钥,您的密钥将专门存储在您的浏览器中,并且永远不会与任何第三方实体共享。它仅用于访问 OpenAI API 的预期用途,而不会用于任何其他未经授权的用途。"
+ },
+ "support": {
+ "title": "支持",
+ "paragraph1": "在 Free ChatGPT,我们致力于为您提供实用和惊人的功能。就像任何项目一样,您的支持和激励将对我们在保持前进方面起到至关重要的作用!",
+ "paragraph2": "如果您喜欢使用我们的应用程序,我们恳请您给这个<0>项目0>一个 ⭐️。您的认可对我们意义重大,鼓励我们更加努力,以提供最佳的体验。",
+ "paragraph3": "如果您想支持我们的团队,请考虑通过以下方法之一赞助我们。每一份贡献,无论多小,都有助于我们维护和改善我们的服务。",
+ "paragraph4": "感谢您成为我们社区的一员,我们期待着在未来为您提供更好的服务。",
+ "alipay": "支付宝",
+ "wechatPay": "微信支付"
+ }
+}
diff --git a/public/locales/zh-CN/api.json b/public/locales/zh-CN/api.json
new file mode 100644
index 0000000..ade8390
--- /dev/null
+++ b/public/locales/zh-CN/api.json
@@ -0,0 +1,13 @@
+{
+ "securityMessage": "我们高度优先考虑您的 API 密钥的安全,并非常小心地处理它。您的密钥将专门存储在您的浏览器中,并且永远不会与任何第三方实体共享。它仅用于访问 OpenAI API 的预期用途,而不是用于任何其他未经授权的用途。",
+ "apiEndpoint": {
+ "option": "使用免费的 API 端点",
+ "inputLabel": "免费的 API 端点",
+ "description": "使用 <0>Ayaka0> 提供的免费 API 端点:https://chatgpt-api.shn.hk/v1/,或输入您自己的 API 端点"
+ },
+ "apiKey": {
+ "option": "使用自己的 API 密钥",
+ "howTo": "在<0>这里0>获取您的个人 API 密钥",
+ "inputLabel": "API 密钥"
+ }
+}
diff --git a/public/locales/zh-CN/main.json b/public/locales/zh-CN/main.json
new file mode 100644
index 0000000..fb4b124
--- /dev/null
+++ b/public/locales/zh-CN/main.json
@@ -0,0 +1,25 @@
+{
+ "save": "保存",
+ "saveAndSubmit": "保存并提交",
+ "cancel": "取消",
+ "confirm": "确认",
+ "warning": "警告",
+ "clearMessageWarning": "请注意,通过提交此消息,所有后续消息都将被删除!",
+ "clearConversationWarning": "请注意,确认此操作将删除所有消息!",
+ "clearConversation": "清除对话",
+ "import": "导入",
+ "export": "导出",
+ "author": "由 Jing Hua 制作",
+ "about": "关于",
+ "api": "API",
+ "personal": "个人",
+ "free": "免费",
+ "downloadChat": "下载聊天记录",
+ "user": "用户",
+ "assistant": "助手",
+ "system": "系统",
+ "newChat": "新聊天",
+ "lightMode": "亮色模式",
+ "darkMode": "黑暗模式",
+ "setting": "设置"
+}
diff --git a/public/locales/zh-CN/model.json b/public/locales/zh-CN/model.json
new file mode 100644
index 0000000..51ce4af
--- /dev/null
+++ b/public/locales/zh-CN/model.json
@@ -0,0 +1,13 @@
+{
+ "configuration": "配置",
+ "model": "模型",
+ "default": "默认",
+ "temperature": {
+ "label": "采样温度",
+ "description": "使用何种采样温度,值在 0 到 2 之间。较高的数值如 0.8 会使输出更加随机,而较低的数值如 0.2 会使输出更加集中和确定。(默认: 1)"
+ },
+ "presencePenalty": {
+ "label": "存在惩罚",
+ "description": "数值在 -2.0 到 2.0 之间。正值会根据新 token 是否已经出现在文本中来惩罚它们,增加模型谈论新话题的可能性。 (默认: 0)"
+ }
+}
diff --git a/src/App.tsx b/src/App.tsx
index a948f4c..630b7e6 100644
--- a/src/App.tsx
+++ b/src/App.tsx
@@ -1,8 +1,9 @@
-import React, { useEffect, useRef } from 'react';
+import React, { useEffect, Suspense } from 'react';
import useStore from '@store/store';
-import Chat from './components/Chat';
-import Menu from './components/Menu';
+import Chat from '@components/Chat';
+import Menu from '@components/Menu';
+import LoadingScreen from '@components/LoadingScreen';
import useInitialiseNewChat from '@hooks/useInitialiseNewChat';
import { ChatInterface } from '@type/chat';
@@ -65,10 +66,12 @@ function App() {
}, []);
return (
-