Skip to content

Commit c078bbb

Browse files
committed
chore: keep source text English
1 parent cfde70c commit c078bbb

112 files changed

Lines changed: 997 additions & 949 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.

apps/pythinker-code/scripts/native/produce-manifest.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ if (!inputDir || !tag) {
2222
process.exit(1);
2323
}
2424

25-
// Tag 格式 `@pymodel/pythinker-code@x.y.z``vx.y.z` `x.y.z`,都归一化到 x.y.z
25+
// Normalize `@pymodel/pythinker-code@x.y.z`, `vx.y.z`, or `x.y.z` to x.y.z.
2626
const version = tag.replace(/^@pymodel\/pythinker-code@/, '').replace(/^v/, '');
2727

2828
const entries = await readdir(inputDir);

apps/pythinker-code/test/tui/components/dialogs/model-selector.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ describe('ModelSelectorComponent', () => {
289289
const picker = new ModelSelectorComponent({
290290
models: {
291291
long: model('A Very Long Model Display Name That Should Be Truncated Hard'),
292-
cjk: model('超长的中文模型名称需要被正确截断处理'),
292+
cjk: model('\u8D85\u957F\u7684\u4E2D\u6587\u6A21\u578B\u540D\u79F0\u9700\u8981\u88AB\u6B63\u786E\u622A\u65AD\u5904\u7406'),
293293
},
294294
currentValue: 'long',
295295
currentThinkingEffort: 'off',

apps/pythinker-code/test/tui/components/dialogs/session-picker.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -255,10 +255,10 @@ describe('SessionPickerComponent', () => {
255255
sessions: [
256256
{
257257
id: 'ses_cjk_long_session_id_value',
258-
title: '现在要重构一下 TUI sessions 列表,要渲染几个字段,让 UI 更好看',
258+
title: '\u73B0\u5728\u8981\u91CD\u6784\u4E00\u4E0B TUI \u7684 sessions \u5217\u8868,\u8981\u6E32\u67D3\u51E0\u4E2A\u5B57\u6BB5,\u8BA9 UI \u66F4\u597D\u770B',
259259
last_prompt:
260-
'我们要渲染几个:sessionid title lastPrompt。工作目录,修改时间。需要重新设计下 UI。',
261-
work_dir: '/Users/someone/Desktop/中文目录/very-long-project-folder-name',
260+
'\u6211\u4EEC\u8981\u6E32\u67D3\u51E0\u4E2A:sessionid title lastPrompt。\u5DE5\u4F5C\u76EE\u5F55,\u4FEE\u6539\u65F6\u95F4。\u9700\u8981\u91CD\u65B0\u8BBE\u8BA1\u4E0B UI。',
261+
work_dir: '/Users/someone/Desktop/\u4E2D\u6587\u76EE\u5F55/very-long-project-folder-name',
262262
updated_at: now - 5 * 60 * 1000,
263263
},
264264
],

apps/pythinker-code/test/tui/components/editor/wrapping-select-list.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ describe('WrappingSelectList', () => {
126126
it('never emits a line wider than the requested width, including CJK text', () => {
127127
const list = new WrappingSelectList(
128128
[
129-
{ value: 'lark', label: 'skill:lark-calendar', description: '管理飞书日历的技能描述'.repeat(8) },
129+
{ value: 'lark', label: 'skill:lark-calendar', description: '\u7BA1\u7406\u98DE\u4E66\u65E5\u5386\u7684\u6280\u80FD\u63CF\u8FF0'.repeat(8) },
130130
{ value: 'init', label: 'init', description: 'word '.repeat(60).trim() },
131131
],
132132
5,

apps/pythinker-code/test/tui/components/messages/assistant-message.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ describe('AssistantMessageComponent', () => {
145145
const component = new AssistantMessageComponent();
146146
try {
147147
setMarkdownRenderLatex(true);
148-
component.updateContent('能量公式 $E = mc^2$');
148+
component.updateContent('\u80FD\u91CF\u516C\u5F0F $E = mc^2$');
149149
expect(strip(component.render(80).join('\n'))).toContain('E = mc²');
150150

151151
setMarkdownRenderLatex(false);

apps/pythinker-code/test/tui/components/messages/goal-panel.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ describe('GoalStatusMessageComponent', () => {
167167
});
168168

169169
it('keeps the status box within narrow widths', () => {
170-
const rendered = new GoalStatusMessageComponent(goal({ objective: '管理飞书日历的技能描述 '.repeat(4).trim() }));
170+
const rendered = new GoalStatusMessageComponent(goal({ objective: '\u7BA1\u7406\u98DE\u4E66\u65E5\u5386\u7684\u6280\u80FD\u63CF\u8FF0 '.repeat(4).trim() }));
171171

172172
for (const width of [39, 24, 20, 10]) {
173173
for (const line of rendered.render(width)) {

apps/pythinker-code/test/tui/fullscreen-layout.test.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ describe('fullscreen layout', () => {
101101
};
102102

103103
// User message, then a streaming assistant message with the activity pane up.
104-
state.transcriptContainer.addChild(new UserMessageComponent('分析下这个项目'));
104+
state.transcriptContainer.addChild(new UserMessageComponent('\u5206\u6790\u4E0B\u8FD9\u4E2A\u9879\u76EE'));
105105
const spinner = new MoonLoader(state.ui);
106106
state.activityContainer.addChild(
107107
new ActivityPaneComponent({ mode: 'tool', spinner, tip: 'streaming' }),
@@ -133,14 +133,14 @@ describe('fullscreen layout', () => {
133133
it('jumps between prompts with Ctrl-Shift-Up/Down (OSC 133 zones survive the chain)', async () => {
134134
const { state, vt } = await mountFullscreen();
135135

136-
state.transcriptContainer.addChild(new UserMessageComponent('第一轮提问'));
136+
state.transcriptContainer.addChild(new UserMessageComponent('\u7B2C\u4E00\u8F6E\u63D0\u95EE'));
137137
const first = new AssistantMessageComponent();
138138
state.transcriptContainer.addChild(first);
139-
first.updateContent(`回答一\n\n${LONG_MARKDOWN}`);
140-
state.transcriptContainer.addChild(new UserMessageComponent('第二轮提问'));
139+
first.updateContent(`\u56DE\u7B54\u4E00\n\n${LONG_MARKDOWN}`);
140+
state.transcriptContainer.addChild(new UserMessageComponent('\u7B2C\u4E8C\u8F6E\u63D0\u95EE'));
141141
const second = new AssistantMessageComponent();
142142
state.transcriptContainer.addChild(second);
143-
second.updateContent(`回答二\n\n${LONG_MARKDOWN}`);
143+
second.updateContent(`\u56DE\u7B54\u4E8C\n\n${LONG_MARKDOWN}`);
144144
state.ui.requestRender(true);
145145
await vt.waitForRender();
146146

@@ -155,15 +155,15 @@ describe('fullscreen layout', () => {
155155
// message that started the turn.
156156
vt.sendInput('\x1b[1;6A'); // ctrl+shift+up = previous prompt
157157
await vt.waitForRender();
158-
expect(topRows()[1]).toContain('回答二');
158+
expect(topRows()[1]).toContain('\u56DE\u7B54\u4E8C');
159159

160160
vt.sendInput('\x1b[1;6A');
161161
await vt.waitForRender();
162-
expect(topRows()[1]).toContain('第二轮提问');
162+
expect(topRows()[1]).toContain('\u7B2C\u4E8C\u8F6E\u63D0\u95EE');
163163

164164
vt.sendInput('\x1b[1;6B'); // ctrl+shift+down = next prompt
165165
await vt.waitForRender();
166-
expect(topRows()[1]).toContain('回答二');
166+
expect(topRows()[1]).toContain('\u56DE\u7B54\u4E8C');
167167

168168
state.ui.stop();
169169
});

apps/pythinker-inspect/src/search/api.test.ts

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const pageData = {
2525
{
2626
session_id: 's1',
2727
workspace_id: 'ws',
28-
session_title: '搜索重构',
28+
session_title: 'Search refactor',
2929
agent_id: 'main',
3030
role: 'assistant',
3131
snippet: 'Here is the apple guide.',
@@ -40,7 +40,7 @@ const pageData = {
4040
session_title: 'title doc',
4141
agent_id: '',
4242
role: 'title',
43-
snippet: '苹果询价',
43+
snippet: 'Apple quote',
4444
time: 1_700_000_100_000,
4545
score: 0.9,
4646
},
@@ -58,7 +58,7 @@ describe('fetchSearchPage', () => {
5858
const page = await fetchSearchPage({
5959
baseUrl: 'http://h:1',
6060
token: 'tok',
61-
query: '苹果',
61+
query: 'apple',
6262
role: 'assistant',
6363
sort: 'time_desc',
6464
pageSize: 20,
@@ -74,7 +74,7 @@ describe('fetchSearchPage', () => {
7474
authorization: 'Bearer tok',
7575
});
7676
expect(JSON.parse(calls[0]!.init?.body as string)).toEqual({
77-
query: '苹果',
77+
query: 'apple',
7878
role: 'assistant',
7979
sort: 'time_desc',
8080
page_size: 20,
@@ -103,7 +103,7 @@ describe('fetchSearchPage', () => {
103103

104104
it('omits the authorization header when no token is configured', async () => {
105105
const { calls, fetchImpl } = fakeFetch(okEnvelope(pageData));
106-
await fetchSearchPage({ baseUrl: 'http://h:1', query: '苹果', fetchImpl });
106+
await fetchSearchPage({ baseUrl: 'http://h:1', query: 'apple', fetchImpl });
107107
expect(calls[0]!.init?.headers).toEqual({ 'content-type': 'application/json' });
108108
});
109109

@@ -127,15 +127,15 @@ describe('fetchSearchPage', () => {
127127

128128
it('leaves incomplete undefined for absent or unexpected values', async () => {
129129
const { fetchImpl } = fakeFetch(okEnvelope(pageData));
130-
const page = await fetchSearchPage({ baseUrl: 'http://h:1', query: '苹果', fetchImpl });
130+
const page = await fetchSearchPage({ baseUrl: 'http://h:1', query: 'apple', fetchImpl });
131131
expect(page.incomplete).toBeUndefined();
132132

133133
const { fetchImpl: fetchImpl2 } = fakeFetch(
134134
okEnvelope({ ...pageData, incomplete: 'something_else' }),
135135
);
136136
const page2 = await fetchSearchPage({
137137
baseUrl: 'http://h:1',
138-
query: '苹果',
138+
query: 'apple',
139139
fetchImpl: fetchImpl2,
140140
});
141141
expect(page2.incomplete).toBeUndefined();
@@ -145,51 +145,51 @@ describe('fetchSearchPage', () => {
145145
const { calls, fetchImpl } = fakeFetch(okEnvelope(pageData));
146146
await fetchSearchPage({
147147
baseUrl: 'http://h:1',
148-
query: '苹果',
148+
query: 'apple',
149149
container: { sessionId: 's1' },
150150
fetchImpl,
151151
});
152152
expect(JSON.parse(calls[0]!.init?.body as string)).toEqual({
153-
query: '苹果',
153+
query: 'apple',
154154
container: { session_id: 's1' },
155155
});
156156

157157
const { calls: calls2, fetchImpl: fetchImpl2 } = fakeFetch(okEnvelope(pageData));
158158
await fetchSearchPage({
159159
baseUrl: 'http://h:1',
160-
query: '苹果',
160+
query: 'apple',
161161
container: { sessionId: 's1', agentId: 'main' },
162162
fetchImpl: fetchImpl2,
163163
});
164164
expect(JSON.parse(calls2[0]!.init?.body as string)).toEqual({
165-
query: '苹果',
165+
query: 'apple',
166166
container: { session_id: 's1', agent_id: 'main' },
167167
});
168168
});
169169

170170
it('parses source: live and source: index', async () => {
171171
const { fetchImpl } = fakeFetch(okEnvelope({ ...pageData, source: 'live' }));
172-
const page = await fetchSearchPage({ baseUrl: 'http://h:1', query: '苹果', fetchImpl });
172+
const page = await fetchSearchPage({ baseUrl: 'http://h:1', query: 'apple', fetchImpl });
173173
expect(page.source).toBe('live');
174174

175175
const { fetchImpl: fetchImpl2 } = fakeFetch(okEnvelope({ ...pageData, source: 'index' }));
176176
const page2 = await fetchSearchPage({
177177
baseUrl: 'http://h:1',
178-
query: '苹果',
178+
query: 'apple',
179179
fetchImpl: fetchImpl2,
180180
});
181181
expect(page2.source).toBe('index');
182182
});
183183

184184
it('leaves source undefined for absent or unknown values', async () => {
185185
const { fetchImpl } = fakeFetch(okEnvelope(pageData));
186-
const page = await fetchSearchPage({ baseUrl: 'http://h:1', query: '苹果', fetchImpl });
186+
const page = await fetchSearchPage({ baseUrl: 'http://h:1', query: 'apple', fetchImpl });
187187
expect(page.source).toBeUndefined();
188188

189189
const { fetchImpl: fetchImpl2 } = fakeFetch(okEnvelope({ ...pageData, source: 'whatever' }));
190190
const page2 = await fetchSearchPage({
191191
baseUrl: 'http://h:1',
192-
query: '苹果',
192+
query: 'apple',
193193
fetchImpl: fetchImpl2,
194194
});
195195
expect(page2.source).toBeUndefined();

apps/pythinker-inspect/src/sessions/api.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const pageData = {
3232
id: 's1',
3333
workspace: { id: 'ws1', cwd: '/tmp/proj' },
3434
meta: {
35-
title: '重构会话',
35+
title: 'Refactor session',
3636
last_prompt: null,
3737
created_at: 1_700_000_000_000,
3838
updated_at: 1_700_000_100_000,
@@ -98,7 +98,7 @@ describe('fetchV2SessionsPage', () => {
9898
expect(first.id).toBe('s1');
9999
expect(first.workspace).toEqual({ id: 'ws1', cwd: '/tmp/proj' });
100100
expect(first.meta).toEqual({
101-
title: '重构会话',
101+
title: 'Refactor session',
102102
lastPrompt: null,
103103
createdAt: 1_700_000_000_000,
104104
updatedAt: 1_700_000_100_000,

apps/pythinker-web/src/components/WarningToasts.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ function toastDetails(warning: AppWarning): AppNotice['details'] {
3030
3131
function isError(warning: AppWarning): boolean {
3232
if (isNotice(warning)) return warning.severity === 'error';
33-
return warning.startsWith(`${t('warnings.errorLabel')}:`) || /\b4\d\d\b|error|失败|failed/i.test(warning);
33+
return warning.startsWith(`${t('warnings.errorLabel')}:`) || /\b4\d\d\b|error|failed/i.test(warning);
3434
}
3535
3636
function warningKey(warning: AppWarning): string {

0 commit comments

Comments
 (0)