Subject | MessageFile - simple tests |
---|---|
Author | Leos Urban |
Post date | 2001-02-01T09:06:28Z |
Hello,
I have some new informations about MessageFile property of IB_Connection.
I copied original english file "interbase.msg" to "cs_cz.msg" and put the
new file into INTL directory of IBSERVER installation (the INTL directory I
found in sources of IB, this directory is required).
Then I overwrote some messages in file (from english texts to czech texts),
I did not have any utilities for it.
I tested TIB_Connection.MessageFile - no success.
I wrote very simple application in C - no success.
Sample of C application:
isc_db_handle db = NULL;
isc_tr_handle trans = NULL;
isc_stmt_handle stmt = NULL;
char ISC_FAR * dpb = NULL;
short dpb_length = 0;
XSQLDA ISC_FAR *sqlda;
long status[20];
isc_expand_dpb(&dpb, (short ISC_FAR *) &dpb_length,
isc_dpb_user_name, "sysdba",
isc_dpb_password, "wrong",
isc_dpb_lc_messages, "cs_cz",
NULL);
if (isc_attach_database(status, 0, "fribodemo.gdb", &db, dpb_length, dpb))
isc_print_status(status);
First result:
It looks that GDS library ignores the parameter for language support.
Second result:
When you set environment variable LC_MESSAGES to "cs_cz", it works!
Returned messages are from intl/cs_cz.msg file!
But you need set it in environment BEFORE you run application because..
Third result:
when I set this variable in Delphi, it does not work.
(IBO already has open the GDS Library?)
procedure TForm1.IB_Connection1BeforeConnect(Sender: TIB_Connection);
// FormCreate Event has the same result (does not work)
var
buffer: PChar;
begin
GetMem(buffer,32);
SetEnvironmentVariable('LC_MESSAGES','cs_cz');
GetEnvironmentVariable('LC_MESSAGES',buffer,32);
ShowMessage(StrPas(buffer));
FreeMem(buffer);
end;
And one warning: Firebird does not contain correct libraries
for MSVC C development, I used older from Borland distribution.
Leos
I have some new informations about MessageFile property of IB_Connection.
I copied original english file "interbase.msg" to "cs_cz.msg" and put the
new file into INTL directory of IBSERVER installation (the INTL directory I
found in sources of IB, this directory is required).
Then I overwrote some messages in file (from english texts to czech texts),
I did not have any utilities for it.
I tested TIB_Connection.MessageFile - no success.
I wrote very simple application in C - no success.
Sample of C application:
isc_db_handle db = NULL;
isc_tr_handle trans = NULL;
isc_stmt_handle stmt = NULL;
char ISC_FAR * dpb = NULL;
short dpb_length = 0;
XSQLDA ISC_FAR *sqlda;
long status[20];
isc_expand_dpb(&dpb, (short ISC_FAR *) &dpb_length,
isc_dpb_user_name, "sysdba",
isc_dpb_password, "wrong",
isc_dpb_lc_messages, "cs_cz",
NULL);
if (isc_attach_database(status, 0, "fribodemo.gdb", &db, dpb_length, dpb))
isc_print_status(status);
First result:
It looks that GDS library ignores the parameter for language support.
Second result:
When you set environment variable LC_MESSAGES to "cs_cz", it works!
Returned messages are from intl/cs_cz.msg file!
But you need set it in environment BEFORE you run application because..
Third result:
when I set this variable in Delphi, it does not work.
(IBO already has open the GDS Library?)
procedure TForm1.IB_Connection1BeforeConnect(Sender: TIB_Connection);
// FormCreate Event has the same result (does not work)
var
buffer: PChar;
begin
GetMem(buffer,32);
SetEnvironmentVariable('LC_MESSAGES','cs_cz');
GetEnvironmentVariable('LC_MESSAGES',buffer,32);
ShowMessage(StrPas(buffer));
FreeMem(buffer);
end;
And one warning: Firebird does not contain correct libraries
for MSVC C development, I used older from Borland distribution.
Leos