Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
V6s5, Suggestions, Same App in English and French
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00863849
Message ID:
00864783
Views:
29
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,
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform