[REBOL] Re: coding tricks
From: Steven:White:ci:bloomington:mn:us at: 12-May-2003 12:13
Did you want those mailed to the list or you personally?
Here is one that I DID think of my own, but subsequently discovered
that I did NOT think of first. Someone else, possibly in the library,
has used it also, but I can't remember who, so I can't give credit.
Make a script (sample below) containing words whose values are all the
different bits of text that will appear anywhere in an application.
Write the application (sample below) and "do" the first script to load
all those bits of text.
When coding the application, never hard-code any text. Always use one
of the words that contains the desired text. This includes text on
screens, button text, error messages,...everything you can think of.
Then, if you or anyone else wants your application to be used in
another language, someone has to translate that one file of text values,
and that's it. In fact, considering the nature of REBOL, you should be
able to put a button on a screen that would select and "do" different
language files and switch languages on the fly.
Language file: (This would be called "LANGUAGE.R")
T001: "Welcome to my application"
T002: "Please press a button"
Sample application: (Notice how it "does" LANGUAGE.R)
view layout [
*** END OF SAMPLES ***
City of Bloomington
2215 W Old Shakopee Rd
Bloomington MN 55431-3096
>>> [gchiu--compkarori--co--nz] 05/10/03 03:39AM >>>
Got a special coding trick or Rebol idiom that you use and
wish to share or document?
Rebol Encyclopaedia Project