Add data table: langtxt.dbf // Total five fields, textno - number; MOD_TYPE - Module code; tchinese - Traditional text; schinese - Simplified text; English - English; use to save Label The text langType.dbf // language type, set 1 is Traditional, 2 is Simplified, 3 is English; two fields, one field is type, one field is language description LangValue.dbf // Save the current language type, one field Enough, set the default value of '1'
Add a Label class, add the following code in the init (TextNo) == Allt (this.name) == '1' this.lang_no = allt (tchinese) Else IF allt (langvalue.lang_no) == '2' this.caption = allt (schinese) else this.caption = allt (english) endifendif
Then, in the program, use this new class to increase the Label, Label's Name value definition, and the value of langtxt.textno, then modify the value of LangValue.lang_no, you can switch between three languages ~~
In the same way, add a few words in language, the init code is slightly changed, and the programming of more languages can be implemented; text maintenance will not be very complex ~
The design is not very good, but I believe in practical, if you have a better way, please ask ^ _ ^
(The above method is tested in Traditional 2000, Simplified 98, Traditional 98 / VFP6.0 Traditional Test.)