Hi,
When an MM application is made multi-lingual, the langtranenvironment is used for localizing purposes. This dataenvironment is generated by the Quick start utility based on the the generic project (adataenv.vcx).
This dataenvironment supports
only local data based on the tables lang.dbf and langtran.dbf and the
LOCAL views lv_tran, lv_langtran, lv_msgSvcInit, lv_MsgSvc.
For deployment reasons or when working with ‘remote’ data only (e.g. MSDE), the possibility to use remote data for localizing purposes is desirable. This assumes that two tables with the same structure as lang.dbf and langtran.dbf are created on the back-end as well as the remote views rv_lang, rv_langtran, rv_msgSvc, rv_msgSvcInit.
[The latter can only be created manually: CREATE SQL VIEW "RV_MSGSVCINIT" REMOTE CONNECT "AppConnect" AS SELECT * from msgsvc where ilangid = ?vp_iLangID OR (ilangid = 0 AND ckey NOT IN (SELECT ckey FROM msgsvc WHERE ilangid = ?vp_iLangID)) ]But there is still a problem in the OpenMsgSvc method of the langtranenvironment. This method is called by the Language Manager when a certain language is selected and only the entries that correspond to the applicable language are needed. (filtering the records in MsgSvc) The problem is that the selection of the local view lv_MsgSvcInit is hard-coded.
To make this work for remote views too, I did try this at home and changed the code in the OpenMsgSvc method from
vp_iLangID = tiLanguage
This.ov_msgsvcinit.OpenTable()
USE IN MsgSvc
loSelectDBC = CREATEOBJ('CSelectDBC', This.ov_MsgSvcInit.DataBase)
USE lv_MsgSvcInit ALIAS MsgSvc IN 0 AGAIN SHARED
to:
vp_iLangID = tiLanguage
IF This.nuselocaldataoverride = 2 .OR. This.lUseLocalData = .F. THEN
IF USED('v_MsgSvc')
USE IN v_MsgSvc
ENDIF
loSelectDBC = CREATEOBJ('CSelectDBC', This.ov_MsgSvcInit.DataBase)
USE rv_MsgSvcInit ALIAS MsgSvc IN 0 AGAIN SHARED
ELSE
This.ov_msgsvcinit.OpenTable()
USE IN MsgSvc
loSelectDBC = CREATEOBJ('CSelectDBC', This.ov_MsgSvcInit.DataBase)
USE lv_MsgSvcInit ALIAS MsgSvc IN 0 AGAIN SHARED
ENDIF
which worked for me.
It seems to me that in order to replicate this functionality to all applications, the generic project has to be changed.
Mark
If everything seems to be going well, you obviously don't know what the hell is going on !