Here are some modifications I made in FileMan/Kernel routines on the source from Medsphere's OpenVista SP4. Please note that when I give places of modifications within a routine, these may be not exact, as I have inserted code for my needs.
Routines %DT* : ============== 1) Change the code to handle input when keyboard is switched in greek in various places i.e I X'="" S:"XxΧχ"[X $P(X,"@")="T-1" 2) Translate names of days, and Help displayed to the user when ? issued (Label HELP). Also, code to get input i.e I (%DT["M")!(%DT["Μ") D G 0 instead of original line : I %DT["M") D G 0 3) User response handling as T+1,T-W etc should also be reworked to allow for user defined character for T,W ect
Routines %ZIS1* : ================ 1) Change hardcoded messages i.e I %IS'["Q",$D(XQNOGO) S POP=1 W:'$D(IOP) !,*7,"OUTPUT IS NEVER ALLOWED FOR THIS OPTION" G EXIT I %IS["Q",$D(XQNOGO) W !,*7,"AT THIS TIME, OUTPUT MUST BE QUEUED" 2) Change code performing case conversion to call one central point i.e LOW(%) ;Q $TR(%,"ABCDEFGHIJKLMNOPQRSTUVWXYZ","abcdefghijklmnopqrstuvwxyz") Q $$LOW^XLFSTR(%) ;***GK The LOW^XLFSTR has been changed accordingly to cope with greek characters.
Routine %ZVEMKRN : =================== Modify line GETCHAR+4 to handle characters with ascii value >127 i.e GETCHAR+4 I $A(CHAR)>31,$A(CHAR)<255 W:$G(NOECHO)'=1 CHAR Q ;***GK
%ZVEMKT ======= Translation of status line i.e : INIT1+9 . S VEET("FT",1)=LINE,VEET("FT",2)="<> <ESC>H=Οδηγίες F=Αναζήτηση L=Εντοπισμός" ERROR+3 W $C(7),!?1,"Ακυρη αναφορά global..",! ;**GK
%ZVEMKT1,%ZVEMKTM ================= Modifications to handle hardcoded characters i.e : I KEY="F"!(KEY="L") D FIND(KEY) Q I TYPE="Λ" D I $E(TXT1,1,$L(FIND))=FIND KILL VEET("FIND") Q I TYPE="Φ" D I $E(TXT1,1,$L(FIND))=FIND KILL VEET("FIND") Q
...
READ1+6 I VK="<ΑΘ>" D G READ1 ;**GK READ1+13 I VK="<ΑΔ>",VEET("HLN")<VEET("BOT") D G READ1 ;**GK READ1+26 I ",<HOME>,<F4AL>,"[(","_VK_",")!(KEY="T")!(KEY="Τ") S VEET("TOP")=1 D REDRAW^%ZVEMKT2() Q "QUIT" READ1+27 I ",<END>,<F4AR>,"[(","_VK_",")!(KEY="B")!(KEY="Β") D BOTTOM^%ZVEMKT2(PKG) Q "QUIT"
DDBR ==== Translation of status line i.e : S DDBFTR=$E("Στη> |"_$$EZBLD^DIALOG(8074)_"| Γραμ> Οθόνη>"_$J("",IOM),1,IOM)
Routines : DDBRGE,DDGF0,DDGLBXA,DDWK,DIR0K ========================================== Above routines have in common a mechanism to process kind of shortcut key handling, but only latin characters are supportet. The simplest solution to encance this was to add lines with desired characters i.e :
;;EXIT;F1_"Ε"; ;***GK Greek E
This approach is though not apropriate for all situations as I allready pointed in my previous post.
DDWC1 ===== User interaction in label FIND does not go through the DIALOG file
DDWC ==== As in DDWC1 for labels : TOOLONG,H,CERR
DDW1 ==== Here are DIALOGs in labels AUTOTM,AUTOVAL,SAVE,QUIT,NTS which also need to go through the DIALOG file.
DDGLIBH ======= Same as above for DDBRGE, plus some translations which are not handled by the DIALOG file
DDBRZIS,DDGFFM,DDSRSEL ====================== In these routines I had to modify DIR based interactions with the user : i.e S DIR(0)="FUO^0:78",DIR("A")=" .... The DIALOGs could use DIALOG file
DDWT1 ===== In this routine there is an important modification to do in label READ, in order to handle characters above ascii 127.
Routines : DICATT0,DICATT6,DICATTD1,DICATTD2,DICATTD4 ===================================================== These are importand routines to refactor, because they are used frequently, when defining new FileMan files for an application, otherwise the developer has all the time to translate automatically produced DIALOG. I choose just to translate the messages, as any other solution would be just a matter of time to get overwriten...
DIE2 ==== Messages to go through DIALOG file
DILIBF ====== Replace line : F A=1:1:$L(X) S L=$E(X,A),B=$C($A(L)-32) S C=C_$S(L'?1L:L,B?1L:"Z",1:B) with line : F A=1:1:$L(X) S L=$E(X,A),B=$$UP^XLFSTR(L) S C=C_$S(L'?1L:L,B?1L:"z",1:B) because subtracting 32 does not work in my case ...
DIR01,DIR03 =========== In label RPM there is text that could go through DIALOG File..
In label READ is the same issue like in READ^DDWT1 (filtering characters above ascii 127), these two places make a good example of code needed refactoring by making a call to a common routine, I think.
Routines RGUT ============= I found useful some routines in the RGUT namespace, so I modified the code there to adapt it to my requirements. I don't think there is need to elaborate my modifications as allmost all of them are translations. This package indicates the need for a Library of MUMPS routines (functions/procedures) to handle routine tasks like reading input from user, date handling, interfaces to finder routines etc.
Routines in the VALM namespace : ================================ The routines in this namespace (List Manager) are in my opinion very important and should be considered within the internationalization process, as they comprise a nice development tool for character based applications. I think they could be supported by the DIALOG file for this purpose. A reworking of the documentation with some examples could also be very useful.
VALM ==== HDR+12 Translate message I also translated the text in these line : I '$D(XQORM("B")),VALM("DEFS") S XQORM("B")=$S(VALMLST<VALMCNT:"....",1:"Quit") ;***GK but I have to follow closecly the logic, because things don't go well and quitting does not work properly...
VALM1 ===== Here are some DIALOGs, and messages, which could go through the DIALOG file At label LOWER could be useful a call to XLFSTR ...
VALM11,VALM2,VALM40,VALMD,VALMXQ05 ================================== The DIR DIALOGs here are candidates for entries in the DIALOG file... Some messages, too.
VALMXQ06,VALMXQ09 ================= The case conversions could go through XLFSTR or DILIBF and be more consistent..
VALMXQ11,XQORM4 =============== Line W !,$S(ORUX[","!(ORUX["-") ... could be handelt via DIALOG file. Same for label HELP^VALMXQ12 and XQORM4
VALMXQ13 ======== Label HELP3 : This could go through DIALOG file !
XPDID ===== INIT+.. D SAY^XGF(IOBM+3,0,".....") ;***GK
XQ31 ==== CON+2 W !!,"Πιέστε return για συνέχεια η '^' για έξοδο " R X:DTIME S:'$T X=U ;***GK HDR+2 W @IOF,!,XQHDR(1),?70,"ΣΕΛ. ",XQP S XQP=XQP+1 ;***GK
XQ32 ==== CON+2 I '$D(DUOUT) W !!,"......" R X:DTIME S:'$T X=U S:X=U XQUI=1 ;***GK
XQALERT ======= DISPLAY+... I XQX>0 W:XQX1=0 !!,"....
XQOO2 ===== PAUSE+3 R !!,"Πιέστε RETURN για συνέχεια, η ""^"" για έξοδο quit: ",XQ:DTIME ;**GK
XQOO3 ===== Here are some messages for the DIALOG file.
XQOR2,XQORDD1,XQORM1 ==================== Case conversion could go through a call to $$UP^DILIBF
XQOR4,XQORM,XQORM5,XQTOC,XQUTL,XUS,XUS1A,XUSERNEW,XUSESIG,XUSG1,ZU ================================================================== Messages could go through DIALOG file
I also made some thoughts regarding internationalization as follows :
1) It would be nice when defining a new FileMan field to allow for choosing the language of the help message (field level help). This is important for internationalizing existing VistA modules too, because any translation results in replacing of the original text... 2) Same applies to the option file entries and the protocol file entries. If you just replace the text you loose the original text, if you choose to make new entries you have them twice and this is confusing. 3) Help text of ScreenMan should be adaptable to local needs. I also translated the Problem List module (and was quite successful, allthough it never was used in something else than testing) and made also some notes about hardcoded issues on the routines and, as I remember about a global used by the LEXICON utility. I can try to find these notes, if they are of interest.
|