Localizing mExc with dxgettext

delphi package - automated exception handling
Post Reply
iha
Posts: 9
Joined: Mon Sep 24, 2012 11:36 am

Localizing mExc with dxgettext

Post by iha »

I'm trying to localize the mExc settings using dxgettext and I can't get it working.

My projects' main unit contains this:

Code: Select all

if AppLanguage <> '' then
 begin
  MESettings.ContinueBtnCaption := _('Continue...');
  UseLanguage(AppLanguage);
  TranslateComponent(self);
 end;
The App.PO file has this (besides other translated strings) inside:

Code: Select all

msgid "Continue..."
msgstr "Try to go on"
Now when the AppLanguage='HU', the Continue button in mExc window on error shows "Continue...'.
When AppLanguage='', the Continue button in mExc window on error shows "Continue!" (as it is set in the mExc Settings in Delphi IDE->madExcept Options->Custom strings).
Same happens, when AppLanguage='HU' and I call MESettings.Reload after TranslateComponent(self) the Captions are reverted back to captions set through Delphi IDE->madExcept Options->Custom strings and setting the captions through MESettings at runtime few lines above is ignored.

The translation App.PO/MO file should be OK as other parts of the project are translated correctly. Just the mExc texts remain in the default language as set in Custom strings...

What I'm doing wrong? How should I force mExc to load the translations from the MO file?
madshi
Site Admin
Posts: 10753
Joined: Sun Mar 21, 2004 5:25 pm

Re: Localizing mExc with dxgettext

Post by madshi »

I'm a bit confused.
iha wrote:Now when the AppLanguage='HU', the Continue button in mExc window on error shows "Continue...'.
When AppLanguage='', the Continue button in mExc window on error shows "Continue!" (as it is set in the mExc Settings in Delphi IDE->madExcept Options->Custom strings).
Isn't that as expected?

I'm not familar with dxgettext. I've no idea what "UseLanguage" or "TranslateComponent" do.
Post Reply