feat(transcript): add Chinese script choices

This commit is contained in:
yiling
2026-12-05 11:43:32 +08:00
parent 6c74413375
commit 70e4c63323
19 changed files with 242 additions and 29 deletions
+1 -1
View File
@@ -76,7 +76,7 @@ apps/web/e2e/
| Owner creates a project with a cover image | `tests/project/create-project.spec.ts` |
| Owner opens project cards in new tabs with middle-click and modifier-click | `tests/project/open-in-new-tab.spec.ts` |
| Owner opens a folder card and a file row in new tabs from the context menu | `tests/project/open-in-new-tab.spec.ts` |
| Owner sees the transcript action only when available, generates a transcript from an archived video's context menu, sees progress in card and list metadata across a refresh, and reuses the project status across folders | `tests/project/generate-transcripts.spec.ts` |
| Owner sees the transcript action only when available, requests both Chinese scripts and English from an archived video's context menu, sees progress in card and list metadata across a refresh, and reuses the project status across folders | `tests/project/generate-transcripts.spec.ts` |
| Owner uploads a file or an unsupported file via the "Upload File" context menu action | `tests/project/upload-file.spec.ts` |
| Owner deletes a file, finds it in recently deleted, and restores it | `tests/project/delete-restore.spec.ts` |
| Owner deletes a folder and still sees its contents preview and countdown in recently deleted | `tests/project/delete-restore.spec.ts` |
@@ -12,7 +12,7 @@ test('starts a transcript for an archived video and tracks it in the file metada
const projectPath = `/projects/${projectId}`
const statusPath = `/api${projectPath}/transcription-status`
const folder = await seedFolder(prisma, projectId, rootFolderId, 'Other folder')
const expectedLanguages = ['zh', 'en']
const expectedLanguages = ['zh-Hans', 'zh-Hant', 'en']
let submissions = 0
let rejectSubmission = true
let statusRequests = 0
@@ -34,7 +34,8 @@ test('starts a transcript for an archived video and tracks it in the file metada
model: 'whisper-tiny',
languages: [
{ code: 'en', name: 'English' },
{ code: 'zh', name: 'Chinese' },
{ code: 'zh-Hans', name: 'Simplified Chinese' },
{ code: 'zh-Hant', name: 'Traditional Chinese' },
],
},
}),
@@ -105,10 +106,10 @@ test('starts a transcript for an archived video and tracks it in the file metada
}
await expect(language).toHaveValue('Auto')
await selectLanguage('Chi', 'Chinese')
await selectLanguage('Simplified', 'Chinese (Simplified)')
await generate.click()
await expect(dialog.getByRole('alert')).toBeVisible()
await expect(language).toHaveValue('Chinese')
await expect(language).toHaveValue('Chinese (Simplified)')
await generate.click()
await expect(dialog).toBeHidden()
await expect(metadata).toHaveText('Transcribing…')
@@ -127,6 +128,14 @@ test('starts a transcript for an archived video and tracks it in the file metada
await expect(dateCell).toHaveText(/\d/)
const modifiedDate = await dateCell.innerText()
await openDialog()
await selectLanguage('Traditional', 'Chinese (Traditional)')
await generate.click()
await expect(dialog).toBeHidden()
await expect(dateCell).toHaveText('Transcribing…')
await prisma.workflowTask.updateMany({ where: activeTranscript, data: { status: 'completed' } })
await expect(dateCell).toHaveText(modifiedDate)
await openDialog()
await expect(generate).toBeEnabled()
await selectLanguage('Eng', 'English')