|
|||
|
Localization Tool for VB, Delphi, .NET, C#, VB.NET, XML, Online Help, HTML ... > Technical Support (You need to be registered at the forum to write) > Wish list for software localization tool > Simplified / Tradiditonal Chinese binary inter-conversion macro
|
| Moderated by: Renate.Reinartz, Markus.Kreisel, Jaakko.Salmenius, Ilkka.Salmenius |
|
|||||||||||||
| Simplified / Tradiditonal Chinese binary inter-conversion macro - Wish list for software localization tool - Technical Support (You need to be registered at the forum to write) - Localization Tool for VB, Delphi, .NET, C#, VB.NET, XML, Online Help, HTML ... | ||||||||||||||
| Author | Post | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
||||||||||||||
|
MagicFX Member
|
PASSOLO:http://www.passolo.com/en/home.htm http://teach.hanzify.org/index.php?Go=Show::634-1179118692 Sb. implemented a macro for Passolo to convert simplified Chinese binary to Traditional Chinese binary. Hope sisulizer team can implement Simplified / Tradiditonal Chinese binary inter-conversion macro. It will be very useful, thx.
|
|||||||||||||
| ||||||||||||||
| ||||||||||||||
|
Jaakko.Salmenius Administrator
|
We can implement similar feature. Can you point me out the alorithm that is used when converting Simplified to Traditional. Both scripts use different characters (e.g. different Unicode points). This is why there must be a huge table that contains matching trad. and simp. character. Do you know where to get it? Jaakko
____________________ http://www.sisulizer.com - Three simple steps to localize |
|||||||||||||
| ||||||||||||||
|
||||||||||||||
|
Jaakko.Salmenius Administrator
|
Keep it mind that automatic conversion from Simplified to Traditional is not very accurate. There are about twice as many characters in trad and in some cases the there are multiple choices how to convert simp to trad depending on the context. Generally automatic trad to simp work better because there are very few one to many conversions. Jaakko
____________________ http://www.sisulizer.com - Three simple steps to localize |
|||||||||||||
| ||||||||||||||
| ||||||||||||||
|
MagicFX Member
|
Jaakko.Salmenius wrote: We can implement similar feature. Can you point me out the alorithm that is used when converting Simplified to Traditional. Both scripts use different characters (e.g. different Unicode points). This is why there must be a huge table that contains matching trad. and simp. character. The macro depends on a third engine called ConvertZ http://alf-li.pcdiscuss.com/e_index.html ConvertZ provides both Winodws GUI and console interfaces. The macro uses convertz console to translate simplified chinese to traditional version.
|
|||||||||||||
| ||||||||||||||
|
||||||||||||||
|
MagicFX Member
|
Jaakko.Salmenius wrote: Keep it mind that automatic conversion from Simplified to Traditional is not very accurate. There are about twice as many character in trad and in some cases the there are muptiple choices how to convert simp to trad depending on the context. http://ftp.isu.edu.tw/pub/CPatch/patchutil/bgconv/ BGConv can interconvert Chinese Big5 / GB2312 / Unicode and correct the usage of terms. The author Kiiali is my friend. His email: kiiali_(at)_cpatch.org
|
|||||||||||||
| ||||||||||||||
| ||||||||||||||
|
MagicFX Member
|
''This Macro is to convert automatically a simplified Chinese source list to ''a traditional Chinese translation list. [GBK => BIG5] ''idea and implemented by gnatix 2007.03.18 ''----------------------------------------------------------------------------------------- '' Private Const STARTF_USESHOWWINDOW& = &H1 Private Const NORMAL_PRIORITY_CLASS = &H20& Private Const INFINITE = -1& Private Type STARTUPINFO cb As Long lpReserved As String lpDesktop As String lpTitle As String dwX As Long dwY As Long dwXSize As Long dwYSize As Long dwXCountChars As Long dwYCountChars As Long dwFillAttribute As Long dwFlags As Long wShowWindow As Integer cbReserved2 As Integer lpReserved2 As Long hStdInput As Long hStdOutput As Long hStdError As Long End Type Private Type PROCESS_INFORMATION hProcess As Long hThread As Long dwProcessID As Long dwThreadID As Long End Type Private Declare Function WaitForSingleObject Lib "kernel32" (ByVal _ hHandle As Long, ByVal dwMilliseconds As Long) As Long Private Declare Function CreateProcessA Lib "kernel32" (ByVal _ lpApplicationName As Long, ByVal lpCommandLine As String, ByVal _ lpProcessAttributes As Long, ByVal lpThreadAttributes As Long, _ ByVal bInheritHandles As Long, ByVal dwCreationFlags As Long, _ ByVal lpEnvironment As Long, ByVal lpCurrentDirectory As Long, _ lpStartupInfo As STARTUPINFO, lpProcessInformation As _ PROCESS_INFORMATION) As Long Private Declare Function CloseHandle Lib "kernel32" (ByVal _ hObject As Long) As Long Public Sub ShellWait(Pathname As String, Optional WindowStyle As Long) Dim proc As PROCESS_INFORMATION Dim start As STARTUPINFO Dim ret As Long ' Initialize the STARTUPINFO structure: With start .cb = Len(start) If Not IsMissing(WindowStyle) Then .dwFlags = STARTF_USESHOWWINDOW .wShowWindow = WindowStyle End If End With ' Start the shelled application: ret& = CreateProcessA(0&, Pathname, 0&, 0&, 1&, _ NORMAL_PRIORITY_CLASS, 0&, 0&, start, proc) ' Wait for the shelled application to finish: ret& = WaitForSingleObject(proc.hProcess, INFINITE) ret& = CloseHandle(proc.hProcess) End Sub '' Code above Courtesy of Terry Kreft Sub main Dim src As PslSourceList Dim trns As PslTransLists Dim big5trn As PslTransList Dim prj As PslProject Dim addinid As String Dim concmd As String If PSL.Option(pslOptionSystemLanguage) = 1028 Then Msg01 = "信息" Msg02 = "目前沒有打開方案!" Msg03 = "方案中沒有翻譯列表!" Msg04 = "請選擇一個簡體中文源列表!" Msg05 = "找不到轉換內碼所需要的程序:" Msg06 = "請將它安裝到指定文件夾!" Msg07 = "您選擇了: 源列表 - " Msg08 = "這將復制該源列表中的所有字串到相應的繁體中文翻譯列表。" & Chr$(13) & _ "提示: 復制字串時其內碼將自動從簡體轉換為繁體。" & Chr$(13) & _ " 繁體中文翻譯列表中現有的翻譯將被覆蓋!" & Chr$(13)&Chr$(13) & _ "您想要繼續嗎?" Msg09 = "確認" Msg10 = "轉換內碼時調整繁體中文詞匯(&A)" Msg11 = "是(&Y)" Msg12 = "否(&N)" Msg13 = "正在復制和轉碼字串,請稍候..." Msg14 = "您的方案中沒有 [中文(繁體/台灣)] 語言,請先添加!" Msg15 = "提示: 您選擇的源列表的語言不是 [中文(簡體/中國)]!" Else Msg01 = "陓洘" Msg02 = "醴羶衄湖羲源偶ㄐ" Msg03 = "源偶笢羶衄楹祒蹈桶ㄐ" Msg04 = "恁寁珨跺潠极笢恅埭蹈桶ㄐ" Msg05 = "梑祥善蛌遙囀鎢垀剒猁腔最唗:" Msg06 = "蔚坳假蚾善硌隅恅璃標ㄐ" Msg07 = "蠟恁寁賸: 埭蹈桶 - " Msg08 = "涴蔚葩秶蜆埭蹈桶笢腔垀衄趼揹善眈茼腔楛极笢恅楹祒蹈桶﹝" & Chr$(13) & _ "枑尨: 葩秶趼揹奀囀鎢蔚赻雄植潠极蛌遙峈楛极﹝" & Chr$(13) & _ " 楛极笢恅楹祒蹈桶笢珋衄腔楹祒蔚掩葡裔ㄐ" & Chr$(13)&Chr$(13) & _ "蠟砑猁樟哿鎘ˋ" Msg09 = "" Msg10 = "蛌遙囀鎢奀覃淕楛极笢恅棵颯(&A)" Msg11 = "岆(&Y)" Msg12 = "瘁(&N)" Msg13 = "淏婓葩秶睿蛌鎢趼揹ㄛ尕緊..." Msg14 = "蠟腔源偶笢羶衄 [笢恅(楛极/怢俜)] 逄晟ㄛ珂氝樓ㄐ" Msg15 = "枑尨: 蠟恁寁腔埭蹈桶腔逄晟祥岆 [笢恅(潠极/笢弊)]ㄐ" End If Set prj = PSL.ActiveProject If prj Is Nothing Then MsgBox Msg02,vbOkOnly+vbInformation,Msg01 Exit Sub End If Set trns = prj.TransLists If trns Is Nothing Then MsgBox Msg03,vbOkOnly+vbInformation,Msg01 Exit Sub End If Set src = PSL.ActiveSourceList If src Is Nothing Then MsgBox Msg04,vbOkOnly+vbInformation,Msg01 Exit Sub End If concmd = GetSetting("gb2big5", "settings", "concmd", "C:\Program Files\ConCMD") If PSL.Option(pslOptionSystemLanguage) = 2052 Then addinid = "PASSOLO 恅掛跡宒" Else If PSL.Option(pslOptionSystemLanguage) = 1028 Then addinid = "PASSOLO 文本格式" Else addinid = "PASSOLO text format" End If End If Set big5trn = trns(src, 1028) If Not big5trn Is Nothing Then If Not Dir(concmd & "\concmd.exe") > "" Then MsgBox Msg05 & Chr$(13) & " " & concmd & "\ConCmd.exe" & Chr$(13)&Chr$(13) & Msg06,vbOkOnly+vbInformation,Msg01 Exit Sub End If Dim MsgText As String If src.LangID <> 2052 Then MsgText = Msg15 & Chr$(13)&Chr$(13) Else MsgText = "" End If MsgText = Msg07 & src.Title & ":" & PSL.GetLangCode(src.LangID,pslCodeText) & Chr$(13)&Chr$(13) & MsgText & Msg08 Begin Dialog UserDialog 520,215, Msg09 CheckBox 120,134,280,21,Msg10,.CheckBox Text 40,21,460,112,MsgText Text 400,2,180,15,"(c) by gnatix" PushButton 140,176,100,21,Msg11 PushButton 290,176,100,21,Msg12 End Dialog Dim dlg As UserDialog dlg.CheckBox = 0 If Dialog(dlg) <> 1 Then Exit Sub big5trn.Update If big5trn.IsOpen Then big5trn.Close(pslSaveChanges) Dim prjFolder As String prjFolder = prj.Location Dim dummyTrn As PslTransList prj.Languages.Add(65535) Set dummyTrn = trns(src, 65535) dummyTrn.Language.Option(pslOptionCodepage) = 936 dummyTrn.Update Dim big5TrnListID As String Dim dummyTrnListID As String big5TrnListID = "_(at)_ID" & Str(big5trn.ListID) dummyTrnListID = "_(at)_ID" & Str(dummyTrn.ListID) dummyTrn.Export(addinid, prjFolder & "\~psltms.txt", pslAll) Open prjFolder & "\~psltms.txt" For Input As #1 Open prjFolder & "\~psltmp.txt" For Output As #2 PSL.Output(Msg13) While Not EOF(1) Line Input #1, L$ If L$ = dummyTrnListID Then L$ = big5TrnListID If InStr(L$,"_(at)_CodePage1") = 1 Then L$ = "_(at)_CodePage1 1252" If InStr(L$,"_(at)_CodePage2") = 1 Then L$ = "_(at)_CodePage2 950" Print #2, L$ Wend Close #1 Close #2 prj.Languages.Remove("3ff3f") If dlg.CheckBox = 0 Then Name concmd & "\B5fix.dat" As concmd & "\B5fix.das" ShellWait("""" & concmd & "\ConCmd.exe"" /i:gbk /o:big5 """ & prjFolder & "\~psltmp.txt""") If dlg.CheckBox = 0 Then Name concmd & "\B5fix.das" As concmd & "\B5fix.dat" PSL.Import(addinid, prjFolder & "\~psltmp.txt", pslImportValidate) Kill prjFolder & "\~psltms.txt" Kill prjFolder & "\~psltmp.txt" Else MsgBox Msg14,vbOkOnly+vbInformation,Msg01 End If End Sub
|
|||||||||||||
| ||||||||||||||
|
||||||||||||||
|
MagicFX Member
|
Please take a look of this : http://glossary.pank.org/?query= Input an english or a chinese term, the engine will return a table showing the relationship among its english/traditional/simplified chinese/third party translations. The comment field gives you the reasons for the translation. You can download the core file of this engine: http://ftp.nsysu.edu.tw/cpatch/patchutil/bgconv/cpatch_core14.zip
|
|||||||||||||
| ||||||||||||||
| ||||||||||||||
|
MagicFX Member
|
Google provides simplified / Traditional chinese wab pages interonversion function. It is possible to implement it but i don't know much about the algorithm. Attachment: google.png (Downloaded 12 times)
|
|||||||||||||
| ||||||||||||||
| Current time is 01:36 am | |
| Localization Tool for VB, Delphi, .NET, C#, VB.NET, XML, Online Help, HTML ... > Technical Support (You need to be registered at the forum to write) > Wish list for software localization tool > Simplified / Tradiditonal Chinese binary inter-conversion macro | |
Sisulizer software localization tool - Three simple steps to localize