HTML View for Source and Target Texts

 

Introduction

The following example shows how to use an HTML page displaying the active source and target texts in RC-WinTrans.  The HTML page catches the events "OnSelectTransUnit" and

"OnEditTargetText" sent by RC-WinTrans and displays the current source and target text.  When an item is selected in RC-WinTrans' Text Table view, the source and target text is shown on the HTML page.  If the target text is edited in the Translation Edit bar, the target text on the HTML page is updated immediately.  Likewise, if the text in the Target edit field on the HTML page is edited and saved by pressing the OK button, the target text will be entered and saved in RC-WinTrans' Translation Edit bar.

 

 

Technology

The HTML page "hosts" an RC-WinTrans ActiveX control which represents RC-WinTrans inside of the HTML page.  The ActiveX control automatically makes a connection to the running RC-WinTrans application and routes events from RC-WinTrans to the HTML page.  The HTML page implements two event handlers catching two specific events fired by RC-WinTrans: "OnSelectTransUnit" and OnEditTargetText."  These events inform the HTML page if the active translation unit changes and/or
if the target text is edited in RC-WinTrans' Translation Edit bar.

 

The programming code used to create the HTML page is Visual Basic (VB) script.

 

The RC-WinTrans ActiveX control permits access to the interface (object model) of RC-WinTrans.  This functionality has been tested for use by scripting languages such as VB script and Java script and for use in HTML documents.

 

The HTML page acts as a COM client using RC-WinTrans as an automation server.  In principle, the capabilies for using an HTML page as a client and RC-WinTrans as the server application are the same as for a COM client coded in C#, or Win32 C++, for example.

 

 

Activating an HTML Page

To activate the HTML view, start RC-WinTrans and place the HTML page in the Tools bar.  This is the area in RC-WinTrans where HTML views can be placed/displayed.

 

Sample name: "SourceAndTargetText.htm"

Directory (location): ...\Samples\Developing\HTMLView\

 

1.

Start RC-WinTrans.

2.

Open a translation project.

3.

Open the Tools bar by:

a.

pressing the F7 function key; or

b.

selecting the Tools Bar command from the View menu.

4.

Place the HTML page in the Tools bar by:

a.

using the drag-and-drop mechanism to move the HTML page from a File Explorer window to the Tools bar; or

b.

right mouse-click in the Tools bar to open a local menu, then select the Select HTML Page command.

 

^ Top ^

 

Figure:  The RC-WinTrans application with a sample HTML page opened in the Tools bar (right).  The HTML page shows the source and target text of the item selected in the Project window's Text Table view (left).

 

^ Top ^