-
Notifications
You must be signed in to change notification settings - Fork 440
feat(i18n): add Traditional Chinese locale #3853
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
base: main
Are you sure you want to change the base?
Changes from all commits
04d1ba0
030cf64
3e7e930
90cb5f3
c6a2056
64559ab
70a76ac
1342876
018a6ba
af900fc
bf3b7fb
eece8d7
56ebc83
3c60b47
5c5514a
d25bff4
d6045cf
de23be4
c68657d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one | ||
| * or more contributor license agreements. See the NOTICE file | ||
| * distributed with this work for additional information | ||
| * regarding copyright ownership. The ASF licenses this file | ||
| * to you under the Apache License, Version 2.0 (the | ||
| * "License"); you may not use this file except in compliance | ||
| * with the License. You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, | ||
| * software distributed under the License is distributed on an | ||
| * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| * KIND, either express or implied. See the License for the | ||
| * specific language governing permissions and limitations | ||
| * under the License. | ||
| */ | ||
|
|
||
| import { ensureSidebarExpanded, expect, test } from './fixtures'; | ||
|
|
||
| test('switches General Settings from Simplified to Traditional Chinese', async ({ | ||
| window: page, | ||
| }) => { | ||
| await ensureSidebarExpanded(page); | ||
| await page.getByRole('button', { name: '设置', exact: true }).click(); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [P2] Expand the sidebar before trying to open Settings. The shared |
||
| await expect(page.getByRole('main', { name: '设置内容' })).toBeVisible(); | ||
| await page.getByRole('button', { name: '通用', exact: true }).click(); | ||
| await expect(page.getByText('界面语言', { exact: true }).first()).toBeVisible(); | ||
| await page.keyboard.press('Escape'); | ||
|
|
||
| await page.evaluate(async () => { | ||
| await window.maka.settings.update({ personalization: { uiLocale: 'zh-TW' } }); | ||
| }); | ||
| await page.reload(); | ||
| await page.waitForSelector('.maka-composer-editor'); | ||
| await ensureSidebarExpanded(page); | ||
| await page.getByRole('button', { name: '設定', exact: true }).click(); | ||
| await expect(page.getByRole('main', { name: '設定內容' })).toBeVisible(); | ||
| await page.getByRole('button', { name: '通用', exact: true }).click(); | ||
| await expect(page.getByText('介面語言', { exact: true }).first()).toBeVisible(); | ||
| }); | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one | ||
| * or more contributor license agreements. See the NOTICE file | ||
| * distributed with this work for additional information | ||
| * regarding copyright ownership. The ASF licenses this file | ||
| * to you under the Apache License, Version 2.0 (the | ||
| * "License"); you may not use this file except in compliance | ||
| * with the License. You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, | ||
| * software distributed under the License is distributed on an | ||
| * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| * KIND, either express or implied. See the License for the | ||
| * specific language governing permissions and limitations | ||
| * under the License. | ||
| */ | ||
|
|
||
| import assert from 'node:assert/strict'; | ||
| import { test } from 'node:test'; | ||
| import { getAgentGraphPanelCopy } from '../../renderer/agent-graph-panel.js'; | ||
|
|
||
| test('Traditional Chinese Agent Graph copy does not use Simplified fallbacks', () => { | ||
| const copy = getAgentGraphPanelCopy('zh-TW'); | ||
| assert.equal(copy.loading, '正在讀取 Graph 狀態…'); | ||
| assert.equal(copy.openSession, '開啟子任務'); | ||
| assert.equal(copy.currentEpoch, '目前'); | ||
| assert.equal(copy.status('active'), '執行中'); | ||
| }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for tightening this fixture contract to canonical locales. Two call sites were missed:
partialHistoryWindow(line 614) andrailRenderWindow(line 587) still passlocale: "zh". The main fixture parser now accepts onlyzh-CN,zh-TW, oren, so those values become null (and they also contradict this narrowed TypeScript type). In particular, partial-history skips settings seeding but still asserts Simplified-Chinese notice text, so on an English CI host the existing spec should render English and fail. I suggest changing both remaining literals tozh-CNand adding/retaining a focused canonical-fixture assertion. Please push back if another layer intentionally maps these two legacy values.