| James J. Gavan 2006-08-10, 3:55 am |
| Clark F Morris wrote:
>
> Be aware that many languages are more verbose than English and the
> message sizes should take that into account. Of course if your
> message file is multi-lingual all the reports and screens should be.
> This can get interesting and the design even more interesting if
> things like currency display, plain number display and date formatting
> are language and culture sensitive.
IF, and it's a big IF I was using a message file, I think I'd be
inclined to keep one per language ensuring each error-message code was
compatible through the various files.
As it is I would tend to hold separate methods for English, French and
German, applicable to one class. I've allowed for a message of 300
characters - which is more than generous for standard validity messages.
Even if you wanted to use wordy messages like "All files have now been
processed. Check the directoryxxxxxxxxxxxxxxx. Ensure that all files are
validated against xxxxx before proceeding " followed by an OK Pushbutton
- pic x(300) is still pretty generous.
(I haven't checked the sizing for accuracy in the French method).
So, having found a validation error set to appropriate ErrorCode and
invoke the appropriate language errormessage method. I wont guarantee
the French translations which were done by Babelfish :-
*>-------------------------------------------------------------
WORKING-STORAGE SECTION.
01 ValidationFlag pic x(4) comp-5.
88 ValidationOK value 00.
*> 88 Error-PrimeKey value 01.
88 Error-SpecNo value 02.
*> 88 Error-Grade value 03.
88 Error-afnor value 04.
88 Error-bs value 05.
88 Error-din1 value 06.
88 Error-din2 value 07.
88 Error-jis value 08.
88 Error-uni value 09.
88 Error-uns value 10.
88 Error-stressPrevious value 11.
88 Error-StressNext value 12.
88 Error-NoStressValues value 13.
88 Error-MainType value 14.
88 Error-SubType value 15.
88 OKtoDelete value 16.
88 LogicError value 17.
88 ValidationError value 1 thru 99.
*>--------------------------------------------------------------
Method-id. "EnglishErrorMessages".
*>--------------------------------------------------------------
Working-storage section.
copy "\copylib\MessageParams.cpy" replacing ==(tag)== by ==ws==.
*>-------------- MessageParams.cpy ---------------------------
01 ws-MessageParams.
05 MessageType pic 9.
88 TypeCritical value 1.
88 TypeInformation value 2.
88 TypeQuestion value 3.
88 TypeWarning value 4.
05 MessageButtons pic 9.
88 AbortRetryIgnore value 1.
88 Ok value 2.
88 OkCancel value 3.
88 RetryCancel value 4.
88 YesNo value 5.
88 YesNoCancel value 6.
05 MessageLabel pic x(50).
05 MessageText pic x(300).
*>------------------------------------------------------------
01 ws-WindowTitle pic x(14) value "Materials Edit".
78 MC value 17.
78 ML value 50.
01 wa.
05 pic x(ML) value "Error PrimeKey~". *>01
05 pic x(ML) value "Can't have blank Spec No.~". *>02
05 pic x(ML) value "grade~". *>03
05 pic x(ML) value "afnor~". *>04
05 pic x(ML) value "bs~". *>05
05 pic x(ML) value "din1~". *>06
05 pic x(ML) value "din2~". *>07
05 pic x(ML) value "jis~". *>08
05 pic x(ML) value "uni~". *>09
05 pic x(ML) value "uns~". *>10
05. *>11
10 pic x(16) value "Stress Column # ".
10 ColumnNumberP pic z9.
10 pic x(32) value " NOT less than previous value~".
05. *>12
10 pic x(16) value "Stress Column # ".
10 ColumnNumberN pic z9.
10 pic x(32) value " greater than next value~".
05 pic x(ML) value "No stress values have been entered". *>13
05 pic x(ML) value "Invalid MainType~". *>14
05 pic x(ML) value "Invalid SubType~". *>15
05 pic x(ML) value "OK to delete this record ?~". *>16
05 pic x(ML) value "Logic error - contact Tech Support~". *>17
01 wb redefines wa.
05 ws-message occurs MC pic x(ML).
Linkage Section.
01 lnk-response pic x(4) comp-5.
Procedure Division returning lnk-response.
initialize ws-MessageParams
move ws-WindowTitle to MessageLabel
Evaluate true
when Error-StressPrevious
move ws-StressColumn to ColumnNumberP
when Error-StressNext
move ws-StressColumn to ColumnNumberN
End-evaluate
String ws-message (ValidationFlag) delimited by "~"
x"00" delimited by size
into MessageText
End-string
evaluate true
when OKtodelete
set TypeWarning to true
set OkCancel to true
when ValidationFlag > 14
set TypeCritical to true
set OK to true
when other
set TypeWarning to true
set OK to true
End-evaluate
invoke ErrorMessages "showmessage"
using os-Parent ws-MessageParams
returning lnk-response
End Method "EnglishErrorMessages".
*>---------------------------------------------------------------
*>-------------------------------------------------------------
Method-id. "FrenchErrorMessages".
*>--------------------------------------------------------------
Working-storage section.
copy "\copylib\MessageParams.cpy" replacing ==(tag)== by ==ws==.
01 ws-WindowTitle pic x(23) value "Les Matériaux Éditent".
78 MC value 17.
78 ML value 50.
01 wa.
05 pic x(ML) value "Erreur PrimeKey~". *>01
05 pic x(ML) value "Ne peut pas avoir le No. blanc de Spéc.~". *>02
05 pic x(ML) value "grade~". *>03
05 pic x(ML) value "afnor~". *>04
05 pic x(ML) value "bs~". *>05
05 pic x(ML) value "din1~". *>06
05 pic x(ML) value "din2~". *>07
05 pic x(ML) value "jis~". *>08
05 pic x(ML) value "uni~". *>09
05 pic x(ML) value "uns~". *>10
05. *>11
10 pic x(18) value "Colonne D'Effort # ".
10 ColumnNumberP pic z9.
10 pic x(32) value "Valeur pas moins que précédente~".
05. *>12
10 pic x(18) value "Colonne D'Effort # ".
10 ColumnNumberN pic z9.
10 pic x(32) value " prochaine valeur plus grande que~".
05 pic x(ML) value "Aucune valeur d'effort n'a été écrite". *>13
05 pic x(ML) value "MainType Inadmissible~".
*>14
05 pic x(ML) value "SubType Inadmissible~".
*>15
05 pic x(ML) value "CORRECT pour supprimer ce disque ?~".
*>16
05 pic x(ML) value "Erreur de logique - appui de technologie de
contact~". *>17
01 wb redefines wa.
05 ws-message occurs MC pic x(ML).
Linkage Section.
01 lnk-response pic x(4) comp-5.
Procedure Division returning lnk-response.
initialize ws-MessageParams
move ws-WindowTitle to MessageLabel
Evaluate true
when Error-StressPrevious
move ws-StressColumn to ColumnNumberP
when Error-StressNext
move ws-StressColumn to ColumnNumberN
End-evaluate
String ws-message (ValidationFlag) delimited by "~"
x"00" delimited by size
into MessageText
End-string
evaluate true
when OKtodelete
set TypeWarning to true
set OkCancel to true
when ValidationFlag > 14
set TypeCritical to true
set OK to true
when other
set TypeWarning to true
set OK to true
End-evaluate
invoke ErrorMessages "showmessage"
using os-Parent ws-MessageParams
returning lnk-response
End Method "FrenchErrorMessages".
*>---------------------------------------------------------------
*>-------------------------------------------------------------
Method-id. "GermanErrorMessages".
*>--------------------------------------------------------------
Welll - at this point you get the idea so I'm not going to Babel
into Deutsch !
I agree - if you go multi-lingual then you have to have Screens or
Dialogs also multi-lingual - given DLG-CUSTOMER, then you probably have
to store images for DLG-CUSTOMER-E, DLG-CUSTOMER-F, DLG-CUSTOMER-G. What
a pain - still if the bucks are there, then you do it. Don't know if
anybody in Canada knows but, are 'English' systems translated into
French for sale in Quebec - and vice versa ? (I don't think they've
discovered too much oil/gas in Quebec - so that isn't a problem for me
:-) ).
People advocating message files; they didn't say how they are stored.
ISAMs, (and if the index crashes ?) or DB Tables - BUT in a separate
Error.mdb (if you were using MS Access) ????
I didn't use the M/F Exception Error class with a messagefile. Haven't
looked at it in ages but they use either a Sequential or Line
Sequential. Funny, I thought - then realized probably figured it that
way to avoid ISAM crashes. You get at the appropriate message by its
ErrorCode using the Offset in the Message file.
PS: As regards cultural differences, I loved Oliver Wong's message about
'lady' or 'woman' inadvertently coming out as "XXXXX" :-)
Jimmy
|