Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
V6s5, Suggestions, Same App in English and French
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00863849
Message ID:
00864783
Vues:
27
This message has been marked as the solution to the initial question of the thread.
>Is it advisable to make a global translation class
>
>label.init()
>
>This.Caption = goTranslate.Msg(this.caption)
>
>
>this.caption was already English in my case at design time

You can do this in your baseclass once and for all, so you don't have to take care of it anymore.

You should have something like:
*** BaseFormClass::Init()
_Screen.oLanguage.TranslateContainer( this )


*** oLanguage::TranslateContainer( toContainer )

if PemStatus( toContainer, "Caption", 5 )
   * The container has its own caption, translate it
   This.Translate( toContainer.Caption )
endif

* Loop trough all the controls
local loControl as Object
for each loControl in toContainer

   if PemStatus( loControl, "Caption", 5 )
      * The control has caption, translate it
      This.Translate( loControl.Caption )
   endif

   if PemStatus( loControl, "Controls", 5 )
      * It is a container; recurse
      This.TranslateContainer( loControl )
   endif
next
Disclaimer: This code was written right here, and it is not tested.

I hope you got the idea. You should add parameter checking, control other properties beside caption, handle pageframes, and all. Take this as almost pseudo-code.

Best luck,
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform