Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/1813-board-state-i18n.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The Project board's queue rows beside the columns now read **运行中** for a live claim and **已停滞** for a stalled one in the Chinese interface, instead of printing the host's lowercase `running`/`stalled` ids ([#1813](https://github.com/ThinkFlowLab/FlyBot/issues/1813)).
4 changes: 4 additions & 0 deletions core/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -1396,6 +1396,10 @@ var ZH = {
"not-started": "未开始",
"in-progress": "进行中",
"done": "已完成",
// The queue rows beside the columns carry the host's own lease state through the same lookup,
// so the ids that read emits are keys of their own (#1813).
running: "运行中",
stalled: "已停滞",
"Projects": "项目",
"New Project": "新建项目",
"Project name": "项目名称",
Expand Down
4 changes: 4 additions & 0 deletions core/src/client/i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -1349,6 +1349,10 @@ const ZH = {
'not-started': '未开始',
'in-progress': '进行中',
'done': '已完成',
// The queue rows beside the columns carry the host's own lease state through the same lookup,
// so the ids that read emits are keys of their own (#1813).
running: '运行中',
stalled: '已停滞',
'Projects': '项目',
'New Project': '新建项目',
'Project name': '项目名称',
Expand Down
15 changes: 15 additions & 0 deletions core/test/i18n.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,18 @@ test('copy follows the DSH language and stays English without a locale service',
assert.equal(t('Model'), 'Model')
assert.equal(hostText('A Bot named Writer already exists'), 'A Bot named Writer already exists')
})

// #1813: the Project board's queue rows print the host's lowercase lease state through `t()`
// (project-board.js), so those ids have to be dictionary keys themselves. #1768's cases never
// bound a dictionary, which is why a missing entry read as raw English in CI.
test('#1813: the Project board queue states read in Chinese', () => {
const off = installLocale(fakeLocale('zh'))
try {
assert.equal(t('running'), '运行中')
assert.equal(t('stalled'), '已停滞')
} finally {
off()
}
// The board keeps emitting the lowercase ids; only the Chinese dictionary changes.
assert.equal(t('running'), 'running')
})
28 changes: 27 additions & 1 deletion patches/ds-bot/0001-core-fixes.patch
Original file line number Diff line number Diff line change
Expand Up @@ -1438,7 +1438,7 @@ diff --git a/src/client/i18n.js b/src/client/i18n.js
'Working folder': '工作文件夹',
'Working folder: {folder}': '工作文件夹:{folder}',
Folder: '文件夹',
@@ -838,6 +838,65 @@
@@ -838,6 +838,69 @@
'Up one level': '上一级',
'No folders inside.': '里面没有文件夹。',
'Some folders are not shown.': '还有一些文件夹没有显示。',
Expand All @@ -1459,6 +1459,10 @@ diff --git a/src/client/i18n.js b/src/client/i18n.js
+ 'not-started': '未开始',
+ 'in-progress': '进行中',
+ 'done': '已完成',
+ // The queue rows beside the columns carry the host's own lease state through the same lookup,
+ // so the ids that read emits are keys of their own (#1813).
+ running: '运行中',
+ stalled: '已停滞',
+ 'Projects': '项目',
+ 'New Project': '新建项目',
+ 'Project name': '项目名称',
Expand Down Expand Up @@ -11542,3 +11546,25 @@ diff --git a/test/work-dir.test.js b/test/work-dir.test.js
assert.deepEqual(third.created, [{ cwd: third.project }])
assert.match(await third.tool('list_bots', {}, 'a'), new RegExp(`- Builder \\(Build, works in ${escapeRegExp(third.project)}\\)`))
})
diff --git a/test/i18n.test.js b/test/i18n.test.js
--- a/test/i18n.test.js
+++ b/test/i18n.test.js
@@ -49,3 +49,18 @@
assert.equal(t('Model'), 'Model')
assert.equal(hostText('A Bot named Writer already exists'), 'A Bot named Writer already exists')
})
+
+// #1813: the Project board's queue rows print the host's lowercase lease state through `t()`
+// (project-board.js), so those ids have to be dictionary keys themselves. #1768's cases never
+// bound a dictionary, which is why a missing entry read as raw English in CI.
+test('#1813: the Project board queue states read in Chinese', () => {
+ const off = installLocale(fakeLocale('zh'))
+ try {
+ assert.equal(t('running'), '运行中')
+ assert.equal(t('stalled'), '已停滞')
+ } finally {
+ off()
+ }
+ // The board keeps emitting the lowercase ids; only the Chinese dictionary changes.
+ assert.equal(t('running'), 'running')
+})
6 changes: 5 additions & 1 deletion patches/ds-bot/0008-client-bundle.patch
Original file line number Diff line number Diff line change
Expand Up @@ -857,7 +857,7 @@ diff --git a/client.js b/client.js
"Working folder": "工作文件夹",
"Working folder: {folder}": "工作文件夹:{folder}",
Folder: "文件夹",
@@ -887,7 +887,66 @@
@@ -887,7 +887,70 @@
"Use this folder": "使用这个文件夹",
"Up one level": "上一级",
"No folders inside.": "里面没有文件夹。",
Expand All @@ -880,6 +880,10 @@ diff --git a/client.js b/client.js
+ "not-started": "未开始",
+ "in-progress": "进行中",
+ "done": "已完成",
+ // The queue rows beside the columns carry the host's own lease state through the same lookup,
+ // so the ids that read emits are keys of their own (#1813).
+ running: "运行中",
+ stalled: "已停滞",
+ "Projects": "项目",
+ "New Project": "新建项目",
+ "Project name": "项目名称",
Expand Down
3 changes: 2 additions & 1 deletion patches/ds-bot/topics.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@
"test/session-identity.test.js",
"src/host/steward.js",
"test/steward.test.js",
"test/steward-retry.test.js"
"test/steward-retry.test.js",
"test/i18n.test.js"
],
"0002-flybot-api-host": [
"index.js",
Expand Down
Loading