Page 1 of 2

Error Exception only english

Posted: 27.01.2012, 15:38
by sfxcc
Can you add support to number identification of a exeception.

If we want to show the error to the user it show in english and much user dont understand and to convert it so if we want to use other language a id number it was ok because we could show our own exception window.



thanks

Posted: 24.02.2012, 20:48
by EgonHugeist
look to Zeos.inc there are lang-definitions by using compiler directives. The most Exception-Strings are in ZMessages.pas. You can complete them for your language and post it in the forum. Then we can commit them...

Error messages

Posted: 10.07.2012, 13:04
by rrkarlo
In file zmessages.pas you can handle zeos messages. But server messages are defined here:
http://dev.mysql.com/doc/refman//5.5/en ... server.htm
with error code numbers. That messages you can additionaly explain. Server messages in Zeos.inc. are defined as:
SSQLError1 = 'SQL Error: %s';
SSQLError2 = 'SQL Error: %s Code: %d';
SSQLError3 = 'SQL Error: %s Code: %d SQL: %s';
SSQLError4 = 'SQL Error: %s Code: %d Message: %s';

Posted: 10.07.2012, 16:46
by EgonHugeist
rrkarlo,

a good point. Can we handle this as feature request?

Michael

Posted: 10.07.2012, 20:35
by rrkarlo
If, question is for me, answer is yes.

Posted: 10.07.2012, 22:22
by EgonHugeist
rrkarlo,

Thank you for your reply. Feature request added to todo-list.

Michael

Posted: 11.07.2012, 20:03
by Pitfiend
may it be possible to add a language property in the zconnection component?

Posted: 12.07.2012, 11:25
by EgonHugeist
Pitfiend,

Everything might be possible. How do we handle unneeded resource strings in this case?
Feel motivated to help and attach a patch.

There is a lot of other things to to in background. We've fixed zoo many alltime Zeos issues. Our rev-counter increases daily....

Michael

Posted: 13.07.2012, 00:48
by Pitfiend
String resources can be loaded from a file (one file for each language, just the Zeos strings, trying to load messages for every every sql engine is an unneeded pain). If no string file available, you use the default language, english.

That way you don't overload the lib with unneeded resources, and the developers can translate from english to their native language. Only trouble I can see, is to not provide that files to the end user, in any case they still get messages in english.

Will try to make some helpers to allow Zeos to switch languages. Only one question: Are all the strings available as resources? take in mind that if any is still hardcoded then this task is unworthy.

Posted: 13.07.2012, 07:06
by EgonHugeist
Pitfiend,

Getting some help word be great. I would. Like to say 99% of the Messages are available in the ZMessages.pas. It might be possible that there are some view in other uses too. If you see some, define them as constant or add them to your file...

Michael

Posted: 14.07.2012, 04:12
by Pitfiend
I foresee a minor trouble, there are some specific errors por FPC. I'm not used to FPC, neither know if the resource reassignment will work. Anyway will write the helpers for Delphi, maybe you can fix it for FPC.

Posted: 14.07.2012, 16:35
by EgonHugeist
Pitfiend,

Cool! Nice to know! I'll do the golden rest for the FPC. Thank you for your constribution.

Michael

Posted: 28.08.2012, 16:01
by sfxcc
Can you replace the resourcestring with
{DEFINE ENGLISH}
{IFFDEF ENGLISH} {$I EnglishResource}

var cMyErrorMessage1= rResourceErrorMessage1;
var cMyErrorMessage2= rResourceErrorMessage2;
var cMyErrorMessage3= rResourceErrorMessage3;
var cMyErrorMessage4= rResourceErrorMessage4;
var cMyErrorMessage5= rResourceErrorMessage5;
var cMyErrorMessage6= rResourceErrorMessage6;

and if we want change the variable on the fly we can change language on the fly to another language, is better and easy to do ('Still use the existing resourcestrings') the prob is ecery time update zeos ill have to do this.

So can you set it on base.

Posted: 30.08.2012, 02:09
by EgonHugeist
sfxcc,

Sérgio, are you able to attach a patch? Work overload.... :doc:

Posted: 09.10.2012, 01:13
by mdaems
Anything happened in this domain?
Please make sure we don't really want to add required files to our users deliverables by default. So at least one laguage ressource should be built in. If the built in one can be definede in zeos.inc, that would be even better.

Mark