Skip to content

Commit 57c1fc2

Browse files
Enter-tainerInnei
andauthored
chore: add i18n for mp4 utils (#91)
Signed-off-by: Innei <tukon479@gmail.com> Co-authored-by: Innei <tukon479@gmail.com>
1 parent 888a039 commit 57c1fc2

7 files changed

Lines changed: 38 additions & 5 deletions

File tree

apps/web/src/lib/mp4-utils.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { getI18n } from '~/i18n'
2+
13
interface ConversionProgress {
24
isConverting: boolean
35
progress: number
@@ -47,10 +49,11 @@ export async function transmuxMovToMp4Simple(
4749
try {
4850
console.info(`🎯 Starting simple transmux conversion`)
4951

52+
const { t } = getI18n()
5053
onProgress?.({
5154
isConverting: true,
5255
progress: 10,
53-
message: 'Fetching video file...',
56+
message: t('video.conversion.transmux.fetching'),
5457
})
5558

5659
// Fetch the video file
@@ -64,13 +67,13 @@ export async function transmuxMovToMp4Simple(
6467
onProgress?.({
6568
isConverting: true,
6669
progress: 30,
67-
message: 'Analyzing MOV structure...',
70+
message: t('video.conversion.transmux.analyzing'),
6871
})
6972

7073
onProgress?.({
7174
isConverting: true,
7275
progress: 60,
73-
message: 'Converting container format...',
76+
message: t('video.conversion.transmux.converting'),
7477
})
7578

7679
// For now, we'll create a simple container change
@@ -83,7 +86,7 @@ export async function transmuxMovToMp4Simple(
8386
onProgress?.({
8487
isConverting: true,
8588
progress: 80,
86-
message: 'Creating MP4 container...',
89+
message: t('video.conversion.transmux.creating'),
8790
})
8891

8992
// Create blob with MP4 MIME type
@@ -93,7 +96,7 @@ export async function transmuxMovToMp4Simple(
9396
onProgress?.({
9497
isConverting: false,
9598
progress: 100,
96-
message: 'Transmux completed successfully',
99+
message: t('video.conversion.transmux.success'),
97100
})
98101

99102
return {

locales/app/en.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,8 +353,13 @@
353353
"video.conversion.initializing": "Initializing video converter...",
354354
"video.conversion.loading": "Loading video file...",
355355
"video.conversion.starting": "Starting conversion...",
356+
"video.conversion.transmux.analyzing": "Analyzing MOV structure...",
357+
"video.conversion.transmux.converting": "Converting container format...",
358+
"video.conversion.transmux.creating": "Creating MP4 container...",
359+
"video.conversion.transmux.fetching": "Fetching video file...",
356360
"video.conversion.transmux.high.quality": "Using high-quality transmux converter...",
357361
"video.conversion.transmux.not.supported": "Transmux is not supported in this browser",
362+
"video.conversion.transmux.success": "Transmux completed successfully",
358363
"video.conversion.webcodecs.high.quality": "Using high-quality WebCodecs converter...",
359364
"video.conversion.webcodecs.not.supported": "WebCodecs is not supported in this browser",
360365
"video.format.mov.not.supported": "Browser does not support MOV format, conversion required",

locales/app/jp.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,8 +346,13 @@
346346
"video.conversion.initializing": "ビデオコンバーターを初期化しています...",
347347
"video.conversion.loading": "ビデオファイルを読み込んでいます...",
348348
"video.conversion.starting": "変換を開始しています...",
349+
"video.conversion.transmux.analyzing": "MOV構造を解析中...",
350+
"video.conversion.transmux.converting": "コンテナ形式を変換中...",
351+
"video.conversion.transmux.creating": "MP4コンテナを作成中...",
352+
"video.conversion.transmux.fetching": "ビデオファイルを取得中...",
349353
"video.conversion.transmux.high.quality": "高品質トランスマックス変換器を使用中...",
350354
"video.conversion.transmux.not.supported": "このブラウザはトランスマックスをサポートしていません",
355+
"video.conversion.transmux.success": "トランスマックス変換が正常に完了しました",
351356
"video.conversion.webcodecs.high.quality": "高品質の WebCodecs コンバーターを使用しています...",
352357
"video.conversion.webcodecs.not.supported": "このブラウザは WebCodecs をサポートしていません",
353358
"video.format.mov.not.supported": "ブラウザが MOV 形式をサポートしていないため、変換が必要です",

locales/app/ko.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,8 +346,13 @@
346346
"video.conversion.initializing": "비디오 변환기 초기화 중...",
347347
"video.conversion.loading": "비디오 파일 로딩 중...",
348348
"video.conversion.starting": "변환 시작 중...",
349+
"video.conversion.transmux.analyzing": "MOV 구조 분석 중...",
350+
"video.conversion.transmux.converting": "컨테이너 형식 변환 중...",
351+
"video.conversion.transmux.creating": "MP4 컨테이너 생성 중...",
352+
"video.conversion.transmux.fetching": "비디오 파일 가져오는 중...",
349353
"video.conversion.transmux.high.quality": "고품질 트랜스먹스 변환기 사용 중...",
350354
"video.conversion.transmux.not.supported": "이 브라우저는 트랜스먹스를 지원하지 않습니다",
355+
"video.conversion.transmux.success": "트랜스먹스 변환이 성공적으로 완료되었습니다",
351356
"video.conversion.webcodecs.high.quality": "고품질 WebCodecs 변환기 사용 중...",
352357
"video.conversion.webcodecs.not.supported": "이 브라우저는 WebCodecs 를 지원하지 않습니다",
353358
"video.format.mov.not.supported": "브라우저가 MOV 형식을 지원하지 않아 변환이 필요합니다.",

locales/app/zh-CN.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,8 +350,13 @@
350350
"video.conversion.initializing": "正在初始化视频转换器...",
351351
"video.conversion.loading": "正在加载视频文件...",
352352
"video.conversion.starting": "开始转换...",
353+
"video.conversion.transmux.analyzing": "分析 MOV 结构...",
354+
"video.conversion.transmux.converting": "转换容器格式...",
355+
"video.conversion.transmux.creating": "创建 MP4 容器...",
356+
"video.conversion.transmux.fetching": "获取视频文件...",
353357
"video.conversion.transmux.high.quality": "使用高质量转封装转换器...",
354358
"video.conversion.transmux.not.supported": "此浏览器不支持转封装",
359+
"video.conversion.transmux.success": "转封装转换成功完成",
355360
"video.conversion.webcodecs.high.quality": "使用高质量 WebCodecs 转换器...",
356361
"video.conversion.webcodecs.not.supported": "此浏览器不支持 WebCodecs",
357362
"video.format.mov.not.supported": "浏览器不支持 MOV 格式,需要转换",

locales/app/zh-HK.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,8 +346,13 @@
346346
"video.conversion.initializing": "正在初始化影片轉換器...",
347347
"video.conversion.loading": "正在載入影片檔案...",
348348
"video.conversion.starting": "開始轉換...",
349+
"video.conversion.transmux.analyzing": "分析 MOV 結構...",
350+
"video.conversion.transmux.converting": "轉換容器格式...",
351+
"video.conversion.transmux.creating": "建立 MP4 容器...",
352+
"video.conversion.transmux.fetching": "取得影片檔案...",
349353
"video.conversion.transmux.high.quality": "使用高品質轉封裝轉換器...",
350354
"video.conversion.transmux.not.supported": "此瀏覽器不支援轉封裝",
355+
"video.conversion.transmux.success": "轉封裝轉換成功完成",
351356
"video.conversion.webcodecs.high.quality": "使用高品質 WebCodecs 轉換器...",
352357
"video.conversion.webcodecs.not.supported": "此瀏覽器不支援 WebCodecs",
353358
"video.format.mov.not.supported": "瀏覽器不支援 MOV 格式,需要轉換",

locales/app/zh-TW.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,8 +345,13 @@
345345
"video.conversion.initializing": "正在初始化影片轉換器...",
346346
"video.conversion.loading": "正在載入影片檔案...",
347347
"video.conversion.starting": "開始轉換...",
348+
"video.conversion.transmux.analyzing": "分析 MOV 結構...",
349+
"video.conversion.transmux.converting": "轉換容器格式...",
350+
"video.conversion.transmux.creating": "建立 MP4 容器...",
351+
"video.conversion.transmux.fetching": "取得影片檔案...",
348352
"video.conversion.transmux.high.quality": "使用高品質轉封裝轉換器...",
349353
"video.conversion.transmux.not.supported": "此瀏覽器不支援轉封裝",
354+
"video.conversion.transmux.success": "轉封裝轉換成功完成",
350355
"video.conversion.webcodecs.high.quality": "使用高品質 WebCodecs 轉換器...",
351356
"video.conversion.webcodecs.not.supported": "此瀏覽器不支援 WebCodecs",
352357
"video.format.mov.not.supported": "瀏覽器不支援 MOV 格式,需要轉換",

0 commit comments

Comments
 (0)