From 57c1fc25fef6fea8b6b2e0c7e694ac89b8f5fdd8 Mon Sep 17 00:00:00 2001 From: Wenzhuo Liu Date: Mon, 8 Sep 2025 20:34:54 +0800 Subject: [PATCH] chore: add i18n for mp4 utils (#91) Signed-off-by: Innei Co-authored-by: Innei --- apps/web/src/lib/mp4-utils.ts | 13 ++++++++----- locales/app/en.json | 5 +++++ locales/app/jp.json | 5 +++++ locales/app/ko.json | 5 +++++ locales/app/zh-CN.json | 5 +++++ locales/app/zh-HK.json | 5 +++++ locales/app/zh-TW.json | 5 +++++ 7 files changed, 38 insertions(+), 5 deletions(-) diff --git a/apps/web/src/lib/mp4-utils.ts b/apps/web/src/lib/mp4-utils.ts index aceaf32d..9300dd13 100644 --- a/apps/web/src/lib/mp4-utils.ts +++ b/apps/web/src/lib/mp4-utils.ts @@ -1,3 +1,5 @@ +import { getI18n } from '~/i18n' + interface ConversionProgress { isConverting: boolean progress: number @@ -47,10 +49,11 @@ export async function transmuxMovToMp4Simple( try { console.info(`🎯 Starting simple transmux conversion`) + const { t } = getI18n() onProgress?.({ isConverting: true, progress: 10, - message: 'Fetching video file...', + message: t('video.conversion.transmux.fetching'), }) // Fetch the video file @@ -64,13 +67,13 @@ export async function transmuxMovToMp4Simple( onProgress?.({ isConverting: true, progress: 30, - message: 'Analyzing MOV structure...', + message: t('video.conversion.transmux.analyzing'), }) onProgress?.({ isConverting: true, progress: 60, - message: 'Converting container format...', + message: t('video.conversion.transmux.converting'), }) // For now, we'll create a simple container change @@ -83,7 +86,7 @@ export async function transmuxMovToMp4Simple( onProgress?.({ isConverting: true, progress: 80, - message: 'Creating MP4 container...', + message: t('video.conversion.transmux.creating'), }) // Create blob with MP4 MIME type @@ -93,7 +96,7 @@ export async function transmuxMovToMp4Simple( onProgress?.({ isConverting: false, progress: 100, - message: 'Transmux completed successfully', + message: t('video.conversion.transmux.success'), }) return { diff --git a/locales/app/en.json b/locales/app/en.json index 6ebf917c..e490f0b7 100644 --- a/locales/app/en.json +++ b/locales/app/en.json @@ -353,8 +353,13 @@ "video.conversion.initializing": "Initializing video converter...", "video.conversion.loading": "Loading video file...", "video.conversion.starting": "Starting conversion...", + "video.conversion.transmux.analyzing": "Analyzing MOV structure...", + "video.conversion.transmux.converting": "Converting container format...", + "video.conversion.transmux.creating": "Creating MP4 container...", + "video.conversion.transmux.fetching": "Fetching video file...", "video.conversion.transmux.high.quality": "Using high-quality transmux converter...", "video.conversion.transmux.not.supported": "Transmux is not supported in this browser", + "video.conversion.transmux.success": "Transmux completed successfully", "video.conversion.webcodecs.high.quality": "Using high-quality WebCodecs converter...", "video.conversion.webcodecs.not.supported": "WebCodecs is not supported in this browser", "video.format.mov.not.supported": "Browser does not support MOV format, conversion required", diff --git a/locales/app/jp.json b/locales/app/jp.json index 131b7c74..395d4687 100644 --- a/locales/app/jp.json +++ b/locales/app/jp.json @@ -346,8 +346,13 @@ "video.conversion.initializing": "ビデオコンバーターを初期化しています...", "video.conversion.loading": "ビデオファイルを読み込んでいます...", "video.conversion.starting": "変換を開始しています...", + "video.conversion.transmux.analyzing": "MOV構造を解析中...", + "video.conversion.transmux.converting": "コンテナ形式を変換中...", + "video.conversion.transmux.creating": "MP4コンテナを作成中...", + "video.conversion.transmux.fetching": "ビデオファイルを取得中...", "video.conversion.transmux.high.quality": "高品質トランスマックス変換器を使用中...", "video.conversion.transmux.not.supported": "このブラウザはトランスマックスをサポートしていません", + "video.conversion.transmux.success": "トランスマックス変換が正常に完了しました", "video.conversion.webcodecs.high.quality": "高品質の WebCodecs コンバーターを使用しています...", "video.conversion.webcodecs.not.supported": "このブラウザは WebCodecs をサポートしていません", "video.format.mov.not.supported": "ブラウザが MOV 形式をサポートしていないため、変換が必要です", diff --git a/locales/app/ko.json b/locales/app/ko.json index a111342d..c954796d 100644 --- a/locales/app/ko.json +++ b/locales/app/ko.json @@ -346,8 +346,13 @@ "video.conversion.initializing": "비디오 변환기 초기화 중...", "video.conversion.loading": "비디오 파일 로딩 중...", "video.conversion.starting": "변환 시작 중...", + "video.conversion.transmux.analyzing": "MOV 구조 분석 중...", + "video.conversion.transmux.converting": "컨테이너 형식 변환 중...", + "video.conversion.transmux.creating": "MP4 컨테이너 생성 중...", + "video.conversion.transmux.fetching": "비디오 파일 가져오는 중...", "video.conversion.transmux.high.quality": "고품질 트랜스먹스 변환기 사용 중...", "video.conversion.transmux.not.supported": "이 브라우저는 트랜스먹스를 지원하지 않습니다", + "video.conversion.transmux.success": "트랜스먹스 변환이 성공적으로 완료되었습니다", "video.conversion.webcodecs.high.quality": "고품질 WebCodecs 변환기 사용 중...", "video.conversion.webcodecs.not.supported": "이 브라우저는 WebCodecs 를 지원하지 않습니다", "video.format.mov.not.supported": "브라우저가 MOV 형식을 지원하지 않아 변환이 필요합니다.", diff --git a/locales/app/zh-CN.json b/locales/app/zh-CN.json index f16862e0..5dee4d68 100644 --- a/locales/app/zh-CN.json +++ b/locales/app/zh-CN.json @@ -350,8 +350,13 @@ "video.conversion.initializing": "正在初始化视频转换器...", "video.conversion.loading": "正在加载视频文件...", "video.conversion.starting": "开始转换...", + "video.conversion.transmux.analyzing": "分析 MOV 结构...", + "video.conversion.transmux.converting": "转换容器格式...", + "video.conversion.transmux.creating": "创建 MP4 容器...", + "video.conversion.transmux.fetching": "获取视频文件...", "video.conversion.transmux.high.quality": "使用高质量转封装转换器...", "video.conversion.transmux.not.supported": "此浏览器不支持转封装", + "video.conversion.transmux.success": "转封装转换成功完成", "video.conversion.webcodecs.high.quality": "使用高质量 WebCodecs 转换器...", "video.conversion.webcodecs.not.supported": "此浏览器不支持 WebCodecs", "video.format.mov.not.supported": "浏览器不支持 MOV 格式,需要转换", diff --git a/locales/app/zh-HK.json b/locales/app/zh-HK.json index c853f4b5..c86b4752 100644 --- a/locales/app/zh-HK.json +++ b/locales/app/zh-HK.json @@ -346,8 +346,13 @@ "video.conversion.initializing": "正在初始化影片轉換器...", "video.conversion.loading": "正在載入影片檔案...", "video.conversion.starting": "開始轉換...", + "video.conversion.transmux.analyzing": "分析 MOV 結構...", + "video.conversion.transmux.converting": "轉換容器格式...", + "video.conversion.transmux.creating": "建立 MP4 容器...", + "video.conversion.transmux.fetching": "取得影片檔案...", "video.conversion.transmux.high.quality": "使用高品質轉封裝轉換器...", "video.conversion.transmux.not.supported": "此瀏覽器不支援轉封裝", + "video.conversion.transmux.success": "轉封裝轉換成功完成", "video.conversion.webcodecs.high.quality": "使用高品質 WebCodecs 轉換器...", "video.conversion.webcodecs.not.supported": "此瀏覽器不支援 WebCodecs", "video.format.mov.not.supported": "瀏覽器不支援 MOV 格式,需要轉換", diff --git a/locales/app/zh-TW.json b/locales/app/zh-TW.json index 75c188f2..2bcb6f93 100644 --- a/locales/app/zh-TW.json +++ b/locales/app/zh-TW.json @@ -345,8 +345,13 @@ "video.conversion.initializing": "正在初始化影片轉換器...", "video.conversion.loading": "正在載入影片檔案...", "video.conversion.starting": "開始轉換...", + "video.conversion.transmux.analyzing": "分析 MOV 結構...", + "video.conversion.transmux.converting": "轉換容器格式...", + "video.conversion.transmux.creating": "建立 MP4 容器...", + "video.conversion.transmux.fetching": "取得影片檔案...", "video.conversion.transmux.high.quality": "使用高品質轉封裝轉換器...", "video.conversion.transmux.not.supported": "此瀏覽器不支援轉封裝", + "video.conversion.transmux.success": "轉封裝轉換成功完成", "video.conversion.webcodecs.high.quality": "使用高品質 WebCodecs 轉換器...", "video.conversion.webcodecs.not.supported": "此瀏覽器不支援 WebCodecs", "video.format.mov.not.supported": "瀏覽器不支援 MOV 格式,需要轉換",