RVA_ChooseLanguage Function

Top  Previous  Next

Displays a dialog for choosing UI language and applies the chosen language.

Unit RichViewActions.

function RVA_ChooseLanguage: Boolean;

This function displays a dialog containing a list with all available UI languages.

If the user pressed "OK", this function calls RVA_SwitchLanguage and returns True.

You may need to perform additional operations on the language changing, see RVA_SwitchLanguage for details.

Example (from the ActionTest demo):

// button at the right side of status bar

procedure TForm3.Button1Click(Sender: TObject);

begin

  if RVA_ChooseLanguage then

    Localize;

end;

 

procedure TForm3.FormCreate(Sender: TObject);

begin

  ...

  Localize;

  ...

end;

 

procedure TForm3.Localize;

var Index: Integer;

begin

  // Fonts (for Delphi 4-2007)

  Font.Charset            := RVA_GetCharset;

  StatusBar1.Font.Charset := RVA_GetCharset;

  // Fonts (for Delphi 6-2007)

  Screen.HintFont.Charset := RVA_GetCharset;

  Screen.MenuFont.Charset := RVA_GetCharset;

  // Localizing all actions on rvActionsResource

  RVA_LocalizeForm(rvActionsResource);

  // Localizing all actions on this form

  RVA_LocalizeForm(Self);

  // Localizing ruler

  RVALocalizeRuler(RVRuler1);

  // Localizing menus

  mitFile.Caption := RVA_GetS(rvam_menu_File);

  mitEdit.Caption := RVA_GetS(rvam_menu_Edit);

  ...

  // Localizing combobox with units of measurement

  Index := cmbUnits.ItemIndex;

  RVA_TranslateUnits(cmbUnits.Items);

  cmbUnits.ItemIndex := Index;

  // Only if Addict 3 or 4 is used:

  RVAddictSpell31.UILanguage := GetAddictSpellLanguage(RVA_GetLanguageName);

  RVThesaurus31.UILanguage := GetAddictThesLanguage(RVA_GetLanguageName);

end;


RichView © Sergey Tkachenko