用於測試中文 SRT 字幕匯入的小型測試樣本
A small test fixture for Chinese SRT subtitle imports
這份中文 SRT 診斷樣本用兩段字幕,協助逐項檢查編輯器能否顯示中文字元、解析字幕時間碼及保留換行;它是建議使用的測試樣本,並非跨編輯器測試結果。樣本亦説明如何排查文字亂碼、字幕未顯示、時間不符及換行異常,並提醒匯入正常後仍須核對實際翻譯。
A subtitle import problem is easier to isolate with a tiny fixture than with a full video transcript. This example separates three checks: whether the editor can decode Chinese characters, parse cue timing, and keep line breaks. It is a proposed diagnostic fixture, not a report of tests across editing applications.
Start with two cues
Save the following as a UTF-8 text file with an .srt extension:
1
00:00:01,000 --> 00:00:04,000
简体中文测试:你好,世界。
2
00:00:05,000 --> 00:00:08,000
繁體中文測試:你好,世界。
第二行字幕。
The wording is deliberately simple. It is sample text for testing display, not a translation of any real recording.
Diagnose one thing at a time
Garbled characters: reopen the file in a text editor and check its encoding. If the saved file already contains replacement characters, choosing a different font cannot recover the lost text; return to the original export. If the text file is readable but the video editor shows empty boxes, investigate the selected subtitle font and its Chinese glyph coverage.
No subtitles: confirm that the importer expects a subtitle file rather than a video file or plain transcript. Check the extension, the comma before milliseconds, the arrow between timestamps, and the blank line between cues.
Unexpected timing: the first cue should begin one second into the timeline and end at four seconds. The second should start at five seconds and end at eight. Place the test on a matching timeline before diagnosing a full export that may have an offset. A constant offset and progressively increasing drift are different problems; do not fix both by shifting every cue by the same amount.
Unexpected wrapping: the second cue deliberately contains a line break. Check it at the intended video resolution, not just in the text editor. Line length alone does not tell you whether a subtitle is comfortable to read: font size, display duration, and the surrounding image also matter.
Replace the fixture with the real translation
Once the fixture imports correctly, test a short segment of the actual translated subtitles. Review names, numbers, and sentence boundaries against the original audio. A technically valid SRT file can still contain an inaccurate translation. Keep a copy of the original subtitle export before changing timestamps or converting character sets.
Disclosure: this resource is published for PlainChinese, a tool for English-to-Chinese video transcripts and timed subtitles. See PlainChinese for the tool. This post was generated with AI assistance; it does not claim personal testing or independent product endorsement.
來源:DEV Community · dev.to