前期分析见:https://www.chinaavg.com/read.php?tid=12966
& s4 \) ^% H/ _ w
! B* p# L7 R3 d/ S; E( T1 u2 G! g解包后得到的messages.txt 即为字幕文件 K% O0 D# n. r m! b& N
! ~; F7 D8 A4 C/ J) _' P
看起来似乎比较乱,实际上字幕存放地非常工整1 S2 T! F4 X0 G
6 \' U0 K% F5 i, U3 x
把文件中每一个0x0A替换为0x0D0x0A即回车符后,即可得到整齐的文本" ^' q) I8 H8 J. v5 N! n
例:- # ----------------------------
- # Common dialog texts
- # ----------------------------
- # Start Again dialog
- SAD_MainText Do you want to continue your saved game?
- SAD_Title Adventure
- SAD_Continue Continue Game
- SAD_StartNew Start New
- SAD_Cancel Cancel
- # Select Player dialog
- SPD_SelectPlayer Select Player
- SPD_Select Select
- SPD_Cancel Cancel
- SPD_Delete Delete
- SPD_CreateNew Create Player
- SPD_DeletePlayer Delete Player
- SPD_BtnConfirmDelete Delete
- SPD_BtnCancelDelete Cancel
- SPD_ConfirmDelete Are you sure you want to delete this player?
- # Create Player Dialog
- CPD_EnterYourName Please enter your name
- CPD_CreatePlayer Create Player
- CPD_OK OK
- CPD_Cancel Cancel
复制代码 字幕中,#后面的是注释,每一句前面是变量名,这些都是不用翻译的。因此在导出时,每一句导出两遍,句间留空行,如:- 360 19 MMPlay Start Game
- MMPlay 开始游戏
- 380 13 MMExit Exit
- MMExit Exit
- 394 18 MMOptions Options
- MMOptions 选项
- 413 28 MMChangePlayer Change Player
- MMChangePlayer Change Player
- 442 34 MMCurrentPlayer Current Detective
- MMCurrentPlayer Current Detective
- 0 0
复制代码 每一句前面的数字是该句字幕在原文件中的偏移量和长度。2 {! F+ q2 O3 `6 a
翻译的时候就如上直接在第二行上修改即可,方便上下对应,注意翻译后字幕不能大于原字幕长度。; j& O' R% i7 N* Z& r2 x
翻译时写入的是utf-8字符。检验方式:写入中文后保存,用16进制编辑器打开,如前三个字节为16进制的 EF BB BF 即说明是utf-8# G( r4 P; {- e0 ^0 [
3 ^% p0 j. m( e/ k0 V+ {
————————————————————————————————————————————
2 M) z7 u6 H$ [2 u8 D4 _' K. E2 F. X工具使用方法:- h. v" Y$ T! e: f7 ^! \% P
1,字幕导出工具
; z7 x0 C \8 m2 q1 i) h, f) F/ o9 {4 X命令行下:scan <InputFileName> <OutputFileName> <y or n>
- {+ g7 i. m8 r. H4 i( X第三个变量表示是否按翻译模式导出,输入n则如上面第一段,输出工整的原始字幕,做参考。/ `( C" e7 F9 _; L, H% \
输入y则如上面第二段,做翻译用。
. H" G4 v3 o+ U8 }: F; o* C, n例:scan Messages.txt input.txt y$ z; I9 |6 F7 k ], }! Q# o& ?
0 \0 z' G* V1 x; C& K1 {: {- N
2,字幕回写工具
$ ^: W3 p& K4 Y5 i+ ]命令行下:trans <InputFileName> <OutputFileName> <OriginalFileName>
# \$ ?/ n/ d1 O第三个变量是原始文件,默认就是Messages.txt |