Skip to content

Formerly KrillinAI, VideoTranslation and Dubbing Tool for 120+ Languages. Open-source AI workspace for creators, powered by Codex. Video downloader, video translation, create videos, images, audios, and edits with Agents in one place. For your Social Media like YouTube, TikTok, Instagram, etc.

feat: allow French as video translation source language

Mijaelx396e8b80d8a4
diff --git a/apps/daemon/test/unit/creator-krillin-cli-protocol.test.ts b/apps/daemon/test/unit/creator-krillin-cli-protocol.test.ts
index 49f28588..ca301f27 100644
--- a/apps/daemon/test/unit/creator-krillin-cli-protocol.test.ts
+++ b/apps/daemon/test/unit/creator-krillin-cli-protocol.test.ts
@@ -9,8 +9,27 @@ import {
resolveKrillinCliSource
} from '../../src/creator/krillin/cli-runner.js';
import { createKrillinConfigToml } from '../../src/creator/krillin/config-bridge.js';
+import { buildKrillinStageOptions } from '../../src/creator/krillin/adapter.js';
describe('KrillinAI CLI protocol', () => {
+ it.each([true, false])('preserves French-to-Chinese settings through the adapter and CLI with platform captions=%s', preferPlatformCaptions => {
+ const stage = {
+ job: { templateId: 'video-translation', state: {
+ sourceUrl: 'https://youtu.be/french', sourceLanguage: 'fr', targetLanguage: 'zh_cn',
+ bilingual: true, subtitlePosition: 'top', preferPlatformCaptions
+ } },
+ stageRun: { stageId: 'subtitle', id: 'stage' }, workdir: '/job/stage'
+ };
+ const options = buildKrillinStageOptions(stage as never);
+ expect(options).toMatchObject({ originLanguage: 'fr', targetLanguage: 'zh_cn', bilingual: true });
+ const args = buildKrillinCliCommandArguments(stage as never, [], options, undefined);
+ expect(args.slice(args.indexOf('--origin-lang'), args.indexOf('--origin-lang') + 4))
+ .toEqual(['--origin-lang', 'fr', '--target-lang', 'zh_cn']);
+ expect(args[args.indexOf('--caption-source') + 1]).toBe(preferPlatformCaptions ? 'any' : 'whisper');
+ expect(args).toContain('--bilingual-top=true');
+ expect(args).not.toContain('--source-only');
+ });
+
it.each(['source_subtitle', 'target_subtitle'])('passes %s as an explicit CLI input', kind => {
const args = buildKrillinCliCommandArguments({ stageRun: { stageId: 'subtitle', id: 'stage' }, workdir: '/job/stage' } as never,
[{ id: 'srt', kind, path: '/job/local.srt' }], { sourceUrl: 'https://youtu.be/test', originLanguage: 'en', targetLanguage: 'zh_cn' }, undefined);
diff --git a/apps/web/e2e/web-desktop-parity.spec.ts b/apps/web/e2e/web-desktop-parity.spec.ts
index 5ae9c062..6c851de6 100644
--- a/apps/web/e2e/web-desktop-parity.spec.ts
+++ b/apps/web/e2e/web-desktop-parity.spec.ts
@@ -1,6 +1,43 @@
import type { CreatorServicesCapabilitiesResponse, CreatorYtDlpStatusResponse } from '@opencreator/protocol';
import { test, expect } from './fixtures/runtime.js';
+test('法语源语言与中法双语设置在 Browser/Desktop 下保存并重载一致', async ({ browser, runtime }, testInfo) => {
+ test.skip(testInfo.project.name !== 'chromium-desktop');
+ const results: unknown[] = [];
+ for (const platform of ['browser', 'desktop']) {
+ const created = await runtime.api<{ job: { id: string } }>('POST', '/creator/jobs', {
+ projectId: runtime.projectId, templateId: 'video-translation',
+ state: { sourceUrl: 'https://www.youtube.com/watch?v=french', sourceLanguage: 'en',
+ targetLanguage: 'zh_cn', bilingual: true, currentStep: 1, furthestStep: 1 }
+ });
+ const context = await browser.newContext({ viewport: { width: 1280, height: 800 }, reducedMotion: 'reduce' });
+ const page = await context.newPage();
+ if (platform === 'desktop') await installDesktopBridge(page);
+ try {
+ await runtime.openApp(page);
+ await page.goto(`${runtime.origin}/#/workbench?tool=video-translation&jobId=${created.job.id}`);
+ const request = page.waitForRequest(req => req.url().endsWith('/actions')
+ && req.postDataJSON()?.input?.patch?.sourceLanguage === 'fr');
+ await page.getByRole('combobox', { name: '源语言', exact: true }).selectOption('fr');
+ const action = (await request).postDataJSON();
+ const readSettings = async () => {
+ const { job } = await runtime.api<{ job: { state: { sourceLanguage: string; targetLanguage: string; bilingual: boolean } } }>('GET', `/creator/jobs/${created.job.id}`);
+ return { sourceLanguage: job.state.sourceLanguage, targetLanguage: job.state.targetLanguage, bilingual: job.state.bilingual };
+ };
+ await expect.poll(readSettings).toEqual({ sourceLanguage: 'fr', targetLanguage: 'zh_cn', bilingual: true });
+ await page.reload();
+ const source = page.getByRole('combobox', { name: '源语言', exact: true });
+ await expect(source).toHaveValue('fr');
+ await expect(page.getByRole('combobox', { name: '翻译为' })).toHaveValue('zh_cn');
+ await expect(page.getByRole('switch', { name: '双语字幕' })).toBeChecked();
+ results.push({ action: action.action, settings: await readSettings(),
+ requested: { sourceLanguage: action.input.patch.sourceLanguage, targetLanguage: action.input.patch.targetLanguage, bilingual: action.input.patch.bilingual },
+ options: await source.innerText(), sourceBox: await source.boundingBox() });
+ } finally { await context.close(); }
+ }
+ expect(results[1]).toEqual(results[0]);
+});
+
test('Agent 面板在 Browser/Desktop Bridge 下均不显示产物版本详情', async ({ browser, runtime }, testInfo) => {
test.skip(testInfo.project.name !== 'chromium-desktop', '内部使用相同内容视口');
const created = await runtime.api<{ job: { id: string } }>('POST', '/creator/jobs', {
diff --git a/apps/web/src/features/dashboard/VideoTranslationWorkspace.control.test.tsx b/apps/web/src/features/dashboard/VideoTranslationWorkspace.control.test.tsx
index 3313c023..afb95160 100644
--- a/apps/web/src/features/dashboard/VideoTranslationWorkspace.control.test.tsx
+++ b/apps/web/src/features/dashboard/VideoTranslationWorkspace.control.test.tsx
@@ -216,7 +216,7 @@ describe('VideoTranslationWorkspace task controls', () => {
expect(persistedPatch).not.toHaveProperty('subtitleColor');
});
- it('offers the complete target language catalog without expanding unsupported source languages', () => {
+ it('offers French as a source language alongside the complete target language catalog', () => {
render(
<LanguageProvider initialPreference="zh-CN">
<CreatorSessionProvider
@@ -239,7 +239,8 @@ describe('VideoTranslationWorkspace task controls', () => {
const targetOptions = within(targetSelect).getAllByRole('option');
const targetValues = targetOptions.map(option => (option as HTMLOptionElement).value);
- expect(sourceOptions).toHaveLength(8);
+ expect(sourceOptions).toHaveLength(9);
+ expect(within(sourceSelect).getByRole('option', { name: 'Français' })).toHaveAttribute('value', 'fr');
expect(targetOptions).toHaveLength(101);
expect(new Set(targetValues).size).toBe(101);
expect(within(targetSelect).getByRole('option', { name: 'বাংলা' })).toHaveAttribute('value', 'bn');
diff --git a/apps/web/src/features/dashboard/VideoTranslationWorkspace.tsx b/apps/web/src/features/dashboard/VideoTranslationWorkspace.tsx
index 7be8a03c..204acef4 100644
--- a/apps/web/src/features/dashboard/VideoTranslationWorkspace.tsx
+++ b/apps/web/src/features/dashboard/VideoTranslationWorkspace.tsx
@@ -168,6 +168,7 @@ const WORKSPACE_RESIZE_KEY_STEP = 32;
const sourceLanguages: LanguageOption[] = [
{ value: 'zh_cn', label: '简体中文' },
{ value: 'en', label: 'English' },
+ { value: 'fr', label: 'Français' },
{ value: 'ja', label: '日本語' },
{ value: 'ko', label: '한국어' },
{ value: 'de', label: 'Deutsch' },