Localization of RichViewActions

<< Click to display table of contents >>

Localization of RichViewActions

Changing UI language

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 unit.

Hiding untranslated controls

It is possible that some new features added to RichViewActions were not translated to all languages yet.

Such controls can be hidden by ShowUntranslatedControls global variable.

Excluding languages

You can reduce the size of your application by excluding some languages.

To exclude languages, define one more of the following compiler defines in the options of your project:

RVA_NO_ARMENIAN

RVA_NO_BULGARIAN

RVA_NO_BYELORUSSIAN

RVA_NO_CATALAN

RVA_NO_CHINESE_SIMPL

RVA_NO_CHINESE_TRAD

RVA_NO_CZECH

RVA_NO_DANISH

RVA_NO_DUTCH

RVA_NO_ENGLISH_US

RVA_NO_FARSI

RVA_NO_FINNISH

RVA_NO_FRENCH

RVA_NO_GERMAN

RVA_NO_HINDI

RVA_NO_HUNGARIAN

RVA_NO_ITALIAN

RVA_NO_LITHUANIAN

RVA_NO_MALAY

RVA_NO_NORWEGIAN

RVA_NO_POLISH

RVA_NO_PORTUGUESE_BR

RVA_NO_PORTUGUESE_PT

RVA_NO_ROMANIAN

RVA_NO_RUSSIAN

RVA_NO_SLOVAK

RVA_NO_SLOVENE

RVA_NO_SPANISH

RVA_NO_SWEDISH

RVA_NO_THAI

RVA_NO_TURKISH

RVA_NO_UKRAINIAN

Resource language

There is one special language: "Resource language". It contains the same string as in "English (US)", but they are stored in resources. You can use this language together with an external localization tool.

By default, this language is excluded. You can enable it by removing the following line from RichViewActions.inc:

{$DEFINE RVA_NO_RESOURCELANGUAGE}

Adding a new language

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

1.Open RVAL_EngUS.pas, rename it to RVAL_Greek.pas. Add RVAL_Greek in "uses" of RVALocalize.pas. (If you use Delphi/C++Builder 2009, save this unit as UTF-8).

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

3.Change the call of RVA_RegisterLanguage to RVA_RegisterLanguage('Greek', Ελληνικά', GREEK_CHARSET, @Messages).

4.Remove the call of RVA_SwitchLanguage.

5.Send the translated file to [email protected] for including in the main installation of RichViewActions. Your file will be maintained (it will be corrected when new messages will be added in the future versions of RichViewActions)