RVA_ChooseLanguage Function

<< Click to display table of contents >>

RVA_ChooseLanguage Function

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

Unit RichViewActions.

function RVA_ChooseLanguage(ControlPanel: TRVAControlPanel = nil): 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.

In Delphi 4-2007, this function displays language names in English.

In new versions of Delphi (or if TNT Controls are used), this function displays both English and native language names.

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 5-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);

  // Styles
  rvActionsResource.rvActionStyleInspector1.UpdateInfo;

  RVStyleTemplateComboBox1.Localize;

  // Localizing combobox with units of measurement

  Index := cmbUnits.ItemIndex;

  RVA_TranslateUnits(cmbUnits.Items);

  cmbUnits.ItemIndex := Index;

end;