ImageEn

Language Support


ImageEn provides full localization for twenty-five languages: Arabic, Chinese (Simplified and Traditional), Czech, Danish, Dutch, English, Farsi, Finnish, French, German, Greek, Hungarian, Italian, Japanese, Korean, Norwegian, Polish, Portuguese, Russian, Serbian, Slovenian, Spanish, Swedish and Turkish (Note: machine translation has been used for some localization).



To support localization, you must add the ielang32.dll (for 32bit EXEs) or ielang64.dll (for 64bit EXEs) to your application exe folder (See ImageEn DLL info).

There are around 1,000 localized strings in ImageEn that are used by ImageEn Actions and in dialogs (such as when editing and printing images). Changing the current language requires only setting IEGlobalSettings().MsgLanguage, although the default is msSystem so it should automatically display the correct language for the user. To test the localization, try the demos in the \Actions\ folder.

Note:
If you require localization support without using a DLL you need to undefine IESupportLanguageDLL in ie.inc. You may need to recompile your packages
You can check the coverage for specific languages by reviewing iewords.pas. If you update any of the translated strings, please email your changes to support@imageen.com.
Languages that use extended character sets, such as msArabic, msChinese, msChineseTraditional, msJapanese, msKorean and msRussian, require a Unicode compatible Delphi/C++ version (2009 or newer)


Demos

Demo  Demos\Actions\AllActions\AllActions.dpr
Demo  Demos\Actions\Actions_Folder\FolderMViewActions.dpr
Demo  Demos\Actions\Actions_IERichEdit\RichEditActions.dpr
Demo  Demos\Actions\Actions_Layers\LayerActions.dpr
Demo  Demos\Actions\Actions_MView\MViewActions.dpr
Demo  Demos\Actions\Actions_PDFViewer\PdfViewerActions.dpr
Demo  Demos\Actions\Actions_Viewer\ViewerActions.dpr
Demo  Demos\Other\ImageEn_Dialogs\ImageEn_Dialogs.dpr
Demo  Demos\Other\ImageEnViewToolbar\IEToolbar.dpr
Demo  Demos\PDF\PDFViewerToolbar\PdfViewerToolbar.dpr


Examples

// Set language to Italian
IEGlobalSettings().MsgLanguage := msItalian;

// Change language to Italian and show warning if language dll is not found
IEGlobalSettings().RegisterPlugIns([ iepiLanguages ]);
if not ( iepiLanguages in IEGlobalSettings().ActivePlugIns ) then
  ShowMessage( 'IELang32.dll not found. Please reinstall.' )
else
  IEGlobalSettings().MsgLanguage := msItalian;

// Use ImageEn to localize your buttons
btnOK.Caption := IEGlobalSettings().GetLanguageWord( IEMSG_OK );
btnCancel.Caption := IEGlobalSettings().GetLanguageWord( IEMSG_Cancel );

// Customize ImageEn's translation
IEGlobalSettings().SetLanguageWord( msEnglish, IEMSG_OK, 'Yeah, dude!' );
IEGlobalSettings().SetLanguageWord( msEnglish, IEMSG_Cancel, 'Nah...' );
IEGlobalSettings().UpdateLanguage();


Language Selector Example

// Create a pop up menu to select language

procedure AddLanguagesToMenu(Pop: TPopupMenu; OnClick: TNotifyEvent);
var
  langs: TMsgLanguages;
  i: Integer;
  aLang : TMsgLanguage;
  NewItem: TMenuItem;
begin
  Pop.Items.Clear;
  langs := IEGlobalSettings().GetLanguages();
  for i := Low( langs ) to High( langs ) do
  begin
    aLang := langs[ i ];
    NewItem := TMenuItem.Create( Pop.Owner );
    NewItem.Caption := LanguageToStr( aLang, True );
    NewItem.Hint    := format( iemsg( IEMsg_SetLanguageToX ), [ LanguageToStr( aLang , False ) ]);
    NewItem.Checked := IEGlobalSettings.MsgLanguage = aLang;
    NewItem.Tag := ord(aLang);
    NewItem.OnClick := OnClick;
    Pop.Items.Add(NewItem);

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

procedure TfrmMain.LanguageClick(Sender: TObject);
var
  aLang : TMsgLanguage;
  I: Integer;
begin
  for I := 0 to popLanguage.Items.Count - 1 do
    popLanguage.Items[I].Checked := False;
  aLang := TMsgLanguage(TMenuItem(Sender).Tag);

  try
    IEGlobalSettings.MsgLanguage := aLang;
    TMenuItem(Sender).Checked := True;
  except
    MessageDlg( 'IELang32.dll not found! Copy it to the EXE folder for localization support.', mtInformation, [ mbOK ], 0 );
  end;
end;

procedure TfrmMain.PopupLanguageMenuAtControl(Control: TControl);
begin
  if popLanguage.Items.Count = 0 then
    AddLanguagesToMenu( popLanguage, LanguageClick );
  popLanguage.Popup( Control.ClientOrigin.X, Control.ClientOrigin.Y + Control.Height )
end;




See Also

MsgLanguage
GetLanguages
GetLanguageWord
SetLanguageWord
UpdateLanguage
LanguageToStr