From d39a88c445d963109fe7e958b7a030bdb54e3f0f Mon Sep 17 00:00:00 2001 From: kongkx Date: Mon, 7 Sep 2026 21:32:38 +0800 Subject: [PATCH] fix(locale): send canonical admin locale --- src/api/client.test.ts | 2 +- src/api/client.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/api/client.test.ts b/src/api/client.test.ts index 358f6f0..2f23cde 100644 --- a/src/api/client.test.ts +++ b/src/api/client.test.ts @@ -55,7 +55,7 @@ describe('api client', () => { const [url, init] = fetchMock.mock.calls[0] expect(String(url)).toContain('/api/admin/v1/x') expect(init.headers.Authorization).toBe('Bearer token-1') - expect(init.headers['X-Language-Locale']).toBe('zh-CN') + expect(init.headers['X-Language-Locale']).toBe('zh-Hans') }) it('sends FormData untouched so the browser can set the multipart boundary', async () => { diff --git a/src/api/client.ts b/src/api/client.ts index 2a1dc0f..4888abb 100644 --- a/src/api/client.ts +++ b/src/api/client.ts @@ -93,7 +93,7 @@ async function rawRequest(path: string, options: RequestOptions, retried = false const { accessToken } = useAuthStore.getState() const headers: Record = { Accept: 'application/json', - 'X-Language-Locale': 'zh-CN', + 'X-Language-Locale': 'zh-Hans', } // A FormData body must be passed through untouched: the browser sets // `multipart/form-data` *with the boundary parameter*, which we cannot