Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Why define constants
Message
From
25/10/2006 11:07:09
 
 
To
25/10/2006 10:23:26
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01164235
Message ID:
01164400
Views:
14
This will also work fine:
#If hLanguage="en"
lcERR_MESS_NO_DISK = "There is no disk in the selected drive.  Please ensure that there is a disk in the drive" + CHR(13) + ;
              "reselect the 'Save Changes' Checkbox and click 'Execute' again.  The process will continue" + CHR(13) + ;
              "from where you left off"
lcCap_no_disk = "No Disk in Drive"
#elif hLanguage="sr"
lcERR_MESS_NO_DISK = "Nema diska u jedinici.  Turi bre neki disk u nju" + CHR(13) + ;
              "pa ponovo klikni kućicu 'Snimi' i dugme 'Izvrši'.  Proces će se nastaviti" + CHR(13) + ;
              "tamo gde smo stali."
lcCap_no_disk = "Nema diska u jedinici"
#endif
lcMB_ICONSTOP, "16"

...

MESSAGEBOX( m.lcERR_MESS_NO_DISK, m.lcMB_ICONSTOP, m.lcCap_no_disk)
>But then if you do multilingual app, you can do this:
>
>
>#If hLanguage="en"
>#DEFINE ERR_MESS_NO_DISK "There is no disk in the selected drive.  Please ensure that there is a disk in the drive" + CHR(13) + ;
>              "reselect the 'Save Changes' Checkbox and click 'Execute' again.  The process will continue" + CHR(13) + ;
>              "from where you left off"
>#define cap_no_disk "No Disk in Drive"
>#elif hLanguage="sr"
>#DEFINE ERR_MESS_NO_DISK "Nema diska u jedinici.  Turi bre neki disk u nju" + CHR(13) + ;
>              "pa ponovo klikni kućicu 'Snimi' i dugme 'Izvrši'.  Proces će se nastaviti" + CHR(13) + ;
>              "tamo gde smo stali."
>#define cap_no_disk "Nema diska u jedinici"
>#endif
>#DEFINE MB_ICONSTOP, "16"
>
>...
>
>MESSAGEBOX( ERR_MESS_NO_DISK, MB_ICONSTOP, cap_no_disk)
>
>Not that I like that too much - I was doing that in 2.6 for just two languages, and you simply can't keep something like that in code, you have to have a table with one column per language, and some code to generate .h files from it. Otherwise it becomes quite impossible to find your way around in an editor, once the number of strings surpasses a few screenfuls.
Groet,
Peter de Valença

Constructive frustration is the breeding ground of genius.
If there’s no willingness to moderate for the sake of good debate, then I have no willingness to debate at all.
Let's develop superb standards that will end the holy wars.
"There are three types of people: Alphas and Betas", said the beta decisively.
If you find this message rude or offensive or stupid, please take a step away from the keyboard and try to think calmly about an eventual a possible alternative explanation of my message.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform