Skip to content

Commit bb0b90f

Browse files
authored
refactor: migrate account pages to client i18n (#7515)
* refactor: migrate account pages to client i18n * fix(i18n): handle client namespace load failures * fix(i18n): harden client resource loading * refactor: remove promotion feature * refactor(i18n): remove redundant modal fallback * refactor: preserve app shell for client pages * refactor: avoid duplicate user initialization * fix(i18n): qualify permission labels * refactor: stabilize client-only app shell * fix(i18n): load fallback resources before rendering * feat(i18n): make language switching atomic * test(i18n): cover browser storage fallbacks * fix(i18n): scope language cookie and renew expiry * feat(i18n): forward client language with requests * fix(i18n): isolate share language preferences * fix(i18n): restore language after account navigation * fix(i18n): initialize pages with system language * refactor(i18n): use cookie for initial locale * refactor(i18n): narrow default language sync * perf(i18n): preload account route before navigation * perf(i18n): avoid blocking on business namespaces * i18n * doc
1 parent a286b2a commit bb0b90f

204 files changed

Lines changed: 3718 additions & 1087 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.agents/design/common/client-i18n-csr-migration.md

Lines changed: 721 additions & 0 deletions
Large diffs are not rendered by default.

.forgejo/workflows/test-fastgpt.yaml

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ on:
1717
- 'eslint.config.mjs'
1818
- '.npmrc'
1919
- '.github/workflows/test-fastgpt.yaml'
20+
- '.forgejo/workflows/test-fastgpt.yaml'
2021
workflow_dispatch:
2122

2223
# Only one build per PR branch at a time
@@ -170,9 +171,40 @@ jobs:
170171
projects/app/coverage/coverage-final.json
171172
projects/app/coverage/coverage-summary.json
172173
174+
test-web:
175+
runs-on: ubuntu-latest
176+
steps:
177+
- uses: actions/checkout@v4
178+
with:
179+
ref: ${{ github.event.pull_request.head.ref || github.ref }}
180+
repository: ${{ github.event.pull_request.head.repo.full_name ||
181+
github.repository }}
182+
183+
- uses: pnpm/action-setup@v4
184+
185+
- uses: actions/setup-node@v4
186+
with:
187+
node-version: '24'
188+
cache: 'pnpm'
189+
190+
- name: 'Install Deps'
191+
run: pnpm install --frozen-lockfile
192+
193+
- name: 'Test Web'
194+
run: pnpm --filter=@fastgpt/web test
195+
196+
- name: 'Upload Coverage (Web)'
197+
if: always() && hashFiles('packages/web/coverage/coverage-summary.json') != ''
198+
uses: forgejo/upload-artifact@v4
199+
with:
200+
name: coverage-web
201+
path: |
202+
packages/web/coverage/coverage-final.json
203+
packages/web/coverage/coverage-summary.json
204+
173205
report-coverage:
174206
runs-on: ubuntu-latest
175-
needs: [test-global, test-service, test-app]
207+
needs: [test-global, test-service, test-web, test-app]
176208
if: ${{ always() }}
177209
permissions:
178210
contents: read
@@ -191,6 +223,13 @@ jobs:
191223
path: coverage-artifacts/coverage-service
192224
continue-on-error: true
193225

226+
- name: 'Download Coverage Artifacts'
227+
uses: forgejo/download-artifact@v4
228+
with:
229+
name: coverage-web
230+
path: coverage-artifacts/coverage-web
231+
continue-on-error: true
232+
194233
- name: 'Download Coverage Artifacts'
195234
uses: forgejo/download-artifact@v4
196235
with:
@@ -208,6 +247,7 @@ jobs:
208247
const packages = [
209248
{ name: 'Global', dir: 'coverage-global' },
210249
{ name: 'Service', dir: 'coverage-service' },
250+
{ name: 'Web', dir: 'coverage-web' },
211251
{ name: 'App', dir: 'coverage-app' }
212252
];
213253
const formatPct = (value) => {

.github/workflows/test-fastgpt.yaml

Lines changed: 45 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ jobs:
3737
outputs:
3838
run_global: ${{ steps.scope.outputs.run_global }}
3939
run_service: ${{ steps.scope.outputs.run_service }}
40+
run_web: ${{ steps.scope.outputs.run_web }}
4041
run_app: ${{ steps.scope.outputs.run_app }}
4142
should_report: ${{ steps.scope.outputs.should_report }}
4243

@@ -46,17 +47,20 @@ jobs:
4647
uses: actions/github-script@v7
4748
with:
4849
script: |
49-
const setOutputs = ({ global, service, app }) => {
50-
const shouldReport = global || service || app;
50+
const setOutputs = ({ global, service, web, app }) => {
51+
const shouldReport = global || service || web || app;
5152
core.setOutput('run_global', global ? 'true' : 'false');
5253
core.setOutput('run_service', service ? 'true' : 'false');
54+
core.setOutput('run_web', web ? 'true' : 'false');
5355
core.setOutput('run_app', app ? 'true' : 'false');
5456
core.setOutput('should_report', shouldReport ? 'true' : 'false');
55-
core.info(`Test scopes selected: global=${global}, service=${service}, app=${app}`);
57+
core.info(
58+
`Test scopes selected: global=${global}, service=${service}, web=${web}, app=${app}`
59+
);
5660
};
5761
5862
if (context.eventName !== 'pull_request') {
59-
setOutputs({ global: true, service: true, app: true });
63+
setOutputs({ global: true, service: true, web: true, app: true });
6064
return;
6165
}
6266
@@ -86,6 +90,7 @@ jobs:
8690
8791
const runGlobal = affectsAll || hasPath(['packages/global']);
8892
const runService = affectsAll || hasPath(['packages/global', 'packages/service', 'sdk']);
93+
const runWeb = affectsAll || hasPath(['packages/global', 'packages/web']);
8994
const runApp = affectsAll || hasPath([
9095
'packages/global',
9196
'packages/service',
@@ -94,7 +99,7 @@ jobs:
9499
'sdk'
95100
]);
96101
97-
setOutputs({ global: runGlobal, service: runService, app: runApp });
102+
setOutputs({ global: runGlobal, service: runService, web: runWeb, app: runApp });
98103
99104
test-global:
100105
needs: detect-changes
@@ -197,9 +202,42 @@ jobs:
197202
projects/app/coverage/coverage-final.json
198203
projects/app/coverage/coverage-summary.json
199204
205+
test-web:
206+
needs: detect-changes
207+
if: ${{ needs.detect-changes.outputs.run_web == 'true' }}
208+
runs-on: ubuntu-latest
209+
steps:
210+
- uses: actions/checkout@v4
211+
with:
212+
ref: ${{ github.event.pull_request.head.ref || github.ref }}
213+
repository: ${{ github.event.pull_request.head.repo.full_name ||
214+
github.repository }}
215+
216+
- uses: pnpm/action-setup@v4
217+
218+
- uses: actions/setup-node@v4
219+
with:
220+
node-version: '24'
221+
cache: 'pnpm'
222+
223+
- name: 'Install Deps'
224+
run: pnpm install --frozen-lockfile
225+
226+
- name: 'Test Web'
227+
run: pnpm --filter=@fastgpt/web test
228+
229+
- name: 'Upload Coverage (Web)'
230+
if: always() && hashFiles('packages/web/coverage/coverage-summary.json') != ''
231+
uses: actions/upload-artifact@v4
232+
with:
233+
name: coverage-web
234+
path: |
235+
packages/web/coverage/coverage-final.json
236+
packages/web/coverage/coverage-summary.json
237+
200238
report-coverage:
201239
runs-on: ubuntu-latest
202-
needs: [detect-changes, test-global, test-service, test-app]
240+
needs: [detect-changes, test-global, test-service, test-web, test-app]
203241
if: ${{ always() && needs.detect-changes.outputs.should_report == 'true' }}
204242
permissions:
205243
contents: read
@@ -225,6 +263,7 @@ jobs:
225263
const packages = [
226264
{ name: 'Global', dir: 'coverage-global' },
227265
{ name: 'Service', dir: 'coverage-service' },
266+
{ name: 'Web', dir: 'coverage-web' },
228267
{ name: 'App', dir: 'coverage-app' }
229268
];
230269

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ docker compose up -d
5858
可以使用[Docker](https://doc.fastgpt.io/self-host/deploy/docker)快速部署,也可以使用[Sealos Cloud](https://doc.fastgpt.io/self-host/deploy/sealos) 来一键部署FastGPT。
5959

6060
- **商业版**
61-
如果你需要更完整的功能,或深度的服务支持,可以选择我们的[商业版](https://doc.fastgpt.io/guide/version/commercial)。我们除了提供完整的软件外,还提供相应的场景落地辅导,具体可提交[商业咨询](https://fael3z0zfze.feishu.cn/share/base/form/shrcnjJWtKqjOI9NbQTzhNyzljc?prefill_S=git&hide_S=1)
61+
如果你需要更完整的功能,或深度的服务支持,可以选择我们的[商业版](https://doc.fastgpt.io/guide/version/commercial)。我们除了提供完整的软件外,还提供相应的场景落地辅导,具体可提交[商业咨询](https://fastgpt.cn/zh/contact?utm_source=github&utm_medium=referral&utm_campaign=github_home&utm_content=commercial_consultation)
6262

6363
## 💡 核心功能
6464

README_en.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ If you encounter any issues, you can [view the complete Docker deployment tutori
5858
You can quickly deploy using [Docker](https://doc.fastgpt.io/self-host/deploy/docker) or use [Sealos Cloud](https://doc.fastgpt.io/self-host/deploy/sealos) to deploy FastGPT with one click.
5959

6060
- **Commercial Version**
61-
If you need more complete features or in-depth service support, you can choose our [Commercial Version](https://doc.fastgpt.io/guide/version/commercial). In addition to providing complete software, we also offer implementation guidance for specific scenarios. You can submit a [commercial consultation](https://fael3z0zfze.feishu.cn/share/base/form/shrcnjJWtKqjOI9NbQTzhNyzljc?prefill_S=git&hide_S=1?prefill_S=git&hide_S=1).
61+
If you need more complete features or in-depth service support, you can choose our [Commercial Version](https://doc.fastgpt.io/guide/version/commercial). In addition to providing complete software, we also offer implementation guidance for specific scenarios. You can submit a [commercial consultation](https://fastgpt.cn/en/contact?utm_source=github&utm_medium=referral&utm_campaign=github_home&utm_content=commercial_consultation).
6262

6363
## 💡 Core Features
6464

README_id.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ Jika Anda menghadapi masalah, Anda dapat [melihat tutorial penyebaran Docker len
5858
Anda dapat menyebarkan dengan cepat menggunakan [Docker](https://doc.fastgpt.io/self-host/deploy/docker) atau menggunakan [Sealos Cloud](https://doc.fastgpt.io/self-host/deploy/sealos) untuk menyebarkan FastGPT dengan satu klik.
5959

6060
- **Versi Komersial**
61-
Jika Anda membutuhkan fitur yang lebih lengkap atau dukungan layanan mendalam, Anda dapat memilih [Versi Komersial](https://doc.fastgpt.io/guide/version/commercial). Selain menyediakan perangkat lunak lengkap, kami juga menyediakan panduan implementasi untuk skenario tertentu. Anda dapat mengirimkan [konsultasi komersial](https://fael3z0zfze.feishu.cn/share/base/form/shrcnjJWtKqjOI9NbQTzhNyzljc?prefill_S=git&hide_S=1).
61+
Jika Anda membutuhkan fitur yang lebih lengkap atau dukungan layanan mendalam, Anda dapat memilih [Versi Komersial](https://doc.fastgpt.io/guide/version/commercial). Selain menyediakan perangkat lunak lengkap, kami juga menyediakan panduan implementasi untuk skenario tertentu. Anda dapat mengirimkan [konsultasi komersial](https://fastgpt.cn/en/contact?utm_source=github&utm_medium=referral&utm_campaign=github_home&utm_content=commercial_consultation).
6262

6363
## 💡 Fitur Inti
6464

README_ja.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ docker compose up -d
5858
[Docker](https://doc.fastgpt.io/self-host/deploy/docker) で素早くデプロイするか、[Sealos Cloud](https://doc.fastgpt.io/self-host/deploy/sealos) でワンクリックデプロイが可能です。
5959

6060
- **商用版**
61-
より完全な機能や深いサービスサポートが必要な場合は、[商用版](https://doc.fastgpt.io/guide/version/commercial)をお選びいただけます。完全なソフトウェアの提供に加え、シナリオに応じた導入ガイダンスも提供しています。[商用相談](https://fael3z0zfze.feishu.cn/share/base/form/shrcnjJWtKqjOI9NbQTzhNyzljc?prefill_S=git&hide_S=1)からお問い合わせください。
61+
より完全な機能や深いサービスサポートが必要な場合は、[商用版](https://doc.fastgpt.io/guide/version/commercial)をお選びいただけます。完全なソフトウェアの提供に加え、シナリオに応じた導入ガイダンスも提供しています。[商用相談](https://fastgpt.cn/en/contact?utm_source=github&utm_medium=referral&utm_campaign=github_home&utm_content=commercial_consultation)からお問い合わせください。
6262

6363
## 💡 コア機能
6464

README_th.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ docker compose up -d
5858
คุณสามารถติดตั้งได้อย่างรวดเร็วโดยใช้ [Docker](https://doc.fastgpt.io/self-host/deploy/docker) หรือใช้ [Sealos Cloud](https://doc.fastgpt.io/self-host/deploy/sealos) เพื่อติดตั้ง FastGPT ด้วยคลิกเดียว
5959

6060
- **เวอร์ชันพาณิชย์**
61-
หากคุณต้องการคุณสมบัติที่สมบูรณ์มากขึ้นหรือการสนับสนุนบริการเชิงลึก คุณสามารถเลือก [เวอร์ชันพาณิชย์](https://doc.fastgpt.io/guide/version/commercial) นอกจากการให้ซอฟต์แวร์ที่สมบูรณ์ เรายังให้คำแนะนำการนำไปใช้สำหรับสถานการณ์เฉพาะ คุณสามารถส่ง[ปรึกษาธุรกิจ](https://fael3z0zfze.feishu.cn/share/base/form/shrcnjJWtKqjOI9NbQTzhNyzljc?prefill_S=git&hide_S=1)
61+
หากคุณต้องการคุณสมบัติที่สมบูรณ์มากขึ้นหรือการสนับสนุนบริการเชิงลึก คุณสามารถเลือก [เวอร์ชันพาณิชย์](https://doc.fastgpt.io/guide/version/commercial) นอกจากการให้ซอฟต์แวร์ที่สมบูรณ์ เรายังให้คำแนะนำการนำไปใช้สำหรับสถานการณ์เฉพาะ คุณสามารถส่ง[ปรึกษาธุรกิจ](https://fastgpt.cn/en/contact?utm_source=github&utm_medium=referral&utm_campaign=github_home&utm_content=commercial_consultation)
6262

6363
## 💡 คุณสมบัติหลัก
6464

README_vi.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ Nếu bạn gặp vấn đề, bạn có thể [xem hướng dẫn triển khai
5858
Bạn có thể triển khai nhanh chóng bằng [Docker](https://doc.fastgpt.io/self-host/deploy/docker) hoặc sử dụng [Sealos Cloud](https://doc.fastgpt.io/self-host/deploy/sealos) để triển khai FastGPT bằng một cú nhấp chuột.
5959

6060
- **Phiên Bản Thương Mại**
61-
Nếu bạn cần các tính năng đầy đủ hơn hoặc hỗ trợ dịch vụ chuyên sâu, bạn có thể chọn [Phiên Bản Thương Mại](https://doc.fastgpt.io/guide/version/commercial). Ngoài việc cung cấp phần mềm đầy đủ, chúng tôi còn cung cấp hướng dẫn triển khai cho các kịch bản cụ thể. Bạn có thể gửi [tư vấn thương mại](https://fael3z0zfze.feishu.cn/share/base/form/shrcnjJWtKqjOI9NbQTzhNyzljc?prefill_S=git&hide_S=1).
61+
Nếu bạn cần các tính năng đầy đủ hơn hoặc hỗ trợ dịch vụ chuyên sâu, bạn có thể chọn [Phiên Bản Thương Mại](https://doc.fastgpt.io/guide/version/commercial). Ngoài việc cung cấp phần mềm đầy đủ, chúng tôi còn cung cấp hướng dẫn triển khai cho các kịch bản cụ thể. Bạn có thể gửi [tư vấn thương mại](https://fastgpt.cn/en/contact?utm_source=github&utm_medium=referral&utm_campaign=github_home&utm_content=commercial_consultation).
6262

6363
## 💡 Tính Năng Cốt Lõi
6464

document/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ import FastGPTLink from '@/components/docs/linkFastGPT'; #FastGPT跳转链接组
6161
{
6262
"title": "FastGPT Docs",
6363
"root": true,
64-
"pages": ["[Handshake][联系我们](https://fael3z0zfze.feishu.cn/share/base/form/shrcnjJWtKqjOI9NbQTzhNyzljc?prefill_S=doc&hide_S=1)","index","guide","development","FAQ","shopping_cart","community","hello"], #"hello"原本没有,此外,这里的顺序就是最后文档的展示顺序,现在"hello"文档将会在`introduction`的最后展示
64+
"pages": ["[Handshake][联系我们](https://fastgpt.cn/zh/contact?utm_source=docs&utm_medium=referral&utm_campaign=docs_navigation&utm_content=business_consultation)","index","guide","development","FAQ","shopping_cart","community","hello"], #"hello"原本没有,此外,这里的顺序就是最后文档的展示顺序,现在"hello"文档将会在`introduction`的最后展示
6565
"order": 1
6666
}
6767
```

0 commit comments

Comments
 (0)