Example 1 - Changing simulate translation
This example shows how you can change the way SDL Passolo generates a simulated translation of a source file by implementing a call back handler in the system macro.
To do this you have to implement a call back handler PSL_OnSimulateTranslation, which is called for every string that needs to be translated for the simulation. The macro could look like this:
0001 ' We want to check if Asian characters are processed correctly
0002 Public Sub PSL_OnSimulateTranslation(SrcStr As PslSourceString, _
0003 Text As String, X As Long, Y As Long, _
0004 Cx As Long, Cy As Long, Handled As Boolean)
0005
0006 Handled = True ' Yes we handle simulation
0007
0008 If SrcStr.Type = "DialogFont" Then
0009 Text = "Arial Unicode MS" 'If font, choose a Unicode font
0010 Else
0011 Text = "[" & SrcStr.Text & ChrW(20442) & "]" ' Add chars
0012 End If
0013 End Sub
Line 6 tells Passolo, that the simulation is handled by the call back handler. If Handled is not set to True, the internal simulation will be used.
The automation interface of Passolo exposes nearly all information to the client and there are only very limited checks or restrictions. Line 8 checks what kind of string will be processed and we don't want to translate the dialog font. Instead a dialog font should be used that is able to display Japanese characters.
Line 11 generates the translated string. Apart from the text also the coordinates of dialog Controls can be changed during simulation.
How to use it
Select PslSimTrans as the system macro in the dialog Macro and active the system macro with the command Tools / System Macro / Start System Macro.
Select a translation list and select from the menu String List and then Simulate Translation.