Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
LanguageMgr suggestions
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
The Mere Mortals Framework
Titre:
LanguageMgr suggestions
Divers
Thread ID:
00688092
Message ID:
00688092
Vues:
61
This suggestion probably can't be incorporated into the framework, because it might break previously written apps, but I'll mention it anyway. In the GetLocalizedText() method, it seems like it would make a lot more sense to return the passed in string if a translation is not found. Most of the time, it seems like displaying a message in the default language is much better than displaying nothing at all. And, if you want to capture this with the current code, you end up writing a lot of code like:
lcString = goApp.GetLocalizedText("Hello")

IF EMPTY(lcString)
   lcString = "Hello"
ENDIF

* Do something...
I changed this in my subclass to just return the same string.

Another thing that I changed that might be helpful is I added two properties to LanguageMgr:

lRightToLeft
cSpecialFont

I also added two fields to the language table with the same name.

The properties get set in the SetCurrentLanguage() method. Now when each control localizes itself, you can add code like:
This.RightToLeft = goApp.oLanguageMgr.lRightToLeft

IF !EMPTY(goApp.oLanguageMgr.cSpecialFont)
   This.FontName = goApp.oLanguageMgr.cSpecialFont
ENDIF
This makes it a little easier to support languages that require a special font and/or are written right to left (for example, Arabic).
-Paul

RCS Solutions, Inc.
Blog
Twitter
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform