ImageEn, unit iesettings

TIEGlobalSettings.GetLanguages

TIEGlobalSettings.GetLanguages


Declaration

function GetLanguages(): TMsgLanguages;


Description

Returns an array of languages available to set for ImageEn controls (via MsgLanguage).
The list is alphabetized, other than the first two items which will be "Default" and "English".
If FullOnly is true, then only fully translated languages are included. If false, languages are included which may be partially English.


Demo

Demo  \Demos\Actions\Actions_Viewer\ViewerActions.dpr


Compatibility Info

Prior to 10.2.0, GetLanguages() included a "FullOnly" only parameter. This is no longer needed as all languages have full translations.


Example

// Add all available languages to a Language menu
procedure AddLanguagesToMenu(MI: TMenuItem; OnClick: TNotifyEvent);
var
  i: Integer;
  aLang : TMsgLanguage;
  NewItem: TMenuItem;
begin
  MI.Clear;
  for i := Low( IEGlobalSettings().GetLanguages() ) to High( IEGlobalSettings().GetLanguages() ) do
  begin
    aLang := IEGlobalSettings().GetLanguages()[ i ];
    NewItem := TMenuItem.Create( MI.Owner );
    NewItem.Caption := LanguageToStr(aLang);
    NewItem.Hint    := format( iemsg( IEMsg_SetLanguageToX ), [ NewItem.Caption ]);
    NewItem.Checked := IEGlobalSettings().MsgLanguage = aLang;
    NewItem.Tag := ord(aLang);
    NewItem.OnClick := OnClick;
    MI.Add(NewItem);

    // Add separator for "Default"
    if aLang = msSystem then
    begin
      NewItem := TMenuItem.Create( MI.Owner );
      NewItem.Caption := '-';
      MI.Add(NewItem);
    end;
  end;
end;


See Also

 Language Support
 MsgLanguage
 CurrentMsgLanguage
 GetLanguageWord
 SetLanguageWord
 UpdateLanguage
 LanguageToStr