Localization

Top  Previous  Next

General information

RichViewActions require localization, even if you use only one UI language.

Initially, the language specified in TRVAControlPanel.Language is used. If TRVAControlPanel component is not used, 'English (US)' is used. This language will be used in dialogs displayed by RichViewActions, but Captions and Hints of the actions themselves are not localized yet. Call RVA_LocalizeForm to localize them.

For changing UI language, use RVA_ChooseLanguage function. The topic about this function contains an example.

Other localization functions are declared in RVALocalize and SRVALocalize units.

If you want to add a translation to you language (for example, Greek):

1.First, a translation RichViewActions for TRichViewEdit must be done.

2.Open SRVAL_EngUS.pas, rename it to SRVAL_Greek.pas. Add SRVAL_Greek in "uses" of SRVALocalize.pas. (If you use Delphi/C++Builder 2009+, save this unit as UTF-8).

3.Translate all text in this unit (do not translate comments!)

4.Change the call of SRVA_RegisterLanguage to SRVA_RegisterLanguage('Greek', @Messages).

5.Send the translated file to svt@trichview.com for including in the main installation of ScaleRichView. Your file will be maintained (it will be corrected when new messages will be added in the future versions of RichViewActions and ScaleRichView)

Procedures and functions

The unit SRVALocalize contains the following procedures and functions:

function SRVA_GetS(MsgID: TSRVAMessageID): TRVALocString;

function SRVA_GetPC(MsgID: TSRVAMessageID): PChar;

procedure SRVA_LocalizeToolWindow(ToolWindow: TSRVToolWindow);

procedure SRVA_LocalizeSRichViewEdit(Edit: TSRichViewEdit);

function SRVA_GetUnitsName(Units: TRVUnits): TRVALocString;

SRVA_GetS and SRVA_GetPC return the text of the message by its identifier.

SRVA_LocalizeToolWindow localizes a typical search tool window, assuming that it has buttons in the following order:

go to next/previous page,

find table

find picture

find heading

find hyperlink

find text

The following constants are defined:

  SRV_TOOLWIN_PAGE      = 0;

  SRV_TOOLWIN_TABLE     = 1;

  SRV_TOOLWIN_PICTURE   = 2;

  SRV_TOOLWIN_HEADLINE  = 3;

  SRV_TOOLWIN_HYPERLINK = 4;

  SRV_TOOLWIN_TEXT      = 5;

SRVA_LocalizeSRichViewEdit localizes a TSRichViewEdit control. It changes the following properties of ViewProperty:

HintPrefixText;

Texts

SRVA_GetUnitsName returns name of the given measuring unit.


ScaleRichView © trichview.com