Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to design applications in the Chinese language?
Message
From
02/05/2006 13:31:52
 
 
To
02/05/2006 10:56:03
Walter Meester
HoogkarspelNetherlands
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
01118425
Message ID:
01118479
Views:
16
Hi Walter,

If you go to the trouble to do this, then i would consider using a table-driven language converter for your messages and prompts. That way you can set the language at the start of the program and for every message or prompt scan a table for the appropriate language to display.

For instance,
*--Basic example of principle
CLOSE ALL
CLEAR ALL
CLEAR
SET SAFETY OFF
SET TALK OFF
gilang = 2 && Spanish

CREATE TABLE msgs (cid c(16), ilang n(2,0), cmsg c(100), cmsgid c(16), ctitle c(50))

SELE msgs
INDEX ON ALLTRIM(STR(ilang))+ALLTRIM(cmsgid) TAG cmsglist

APPEND BLANK
REPLACE cid WITH "0000000000000001"
REPLACE ilang WITH 1
REPLACE cmsg WITH "Please enter your name"
REPLACE cmsgid WITH "11"
REPLACE ctitle WITH "Instructions"
APPEND BLANK
REPLACE cid WITH "0000000000000002"
REPLACE ilang WITH 2
REPLACE cmsg WITH "Por favor entre en su nombre"
REPLACE cmsgid WITH "11"
REPLACE ctitle WITH "Instrucciones"
USE IN msgs

*--Display the message
=MESSAGEBOX(getmsg(.F.,"11",1),0+16+4096,getmsg(.T.,"11",1))
=MESSAGEBOX(getmsg(.F.,"11",gilang),0+16+4096,getmsg(.T.,"11",2))

CLOSE ALL

RETURN


FUNCTION getmsg(qtitle, qid, qlang)

IF TYPE('qtitle') <> 'L'
   RETURN ""
ENDIF

IF TYPE('qid') <> 'C' .or. EMPTY(qid)
   RETURN ""
ENDIF

IF TYPE('qlang') <> "N" .or. qlang <=0
   RETURN ""
ENDIF

qlang = ALLTRIM(STR(qlang))

STORE ALIAS() TO curalias

USE msgs ORDER TAG CMSGLIST IN 0

IF INDEXSEEK(qlang+qid,.t.,'msgs','CMSGLIST')
   IF qtitle
      lcReturn = ALLTRIM(msgs.ctitle)
   ELSE
      lcReturn =  ALLTRIM(msgs.cmsg)
   ENDIF
ELSE
   lcReturn = ""
ENDIF

USE IN msgs

IF !EMPTY(curalias) .and. USED(curalias)
   SELECT (curalias)
ENDIF

RETURN lcReturn
>A cient asks whether it is possible to translate an application into chinese.
>
>I already made the application multilanguage by supporting for english, dutch, french, spanish and portugese. But the latest request is adding chinese, which of course uses a total different character set which is double byte.
>
>Can anyone point me in the right direction to adjust the application to translate into chinese ?
>
>TIA
>
>Walter,
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform