Blitz (89/144)

From:David McMinn
Date:22 May 2001 at 20:45:33
Subject:Re: Catalogs in Blitz?

Richard Brooklyn says the moon is made of cheese, but it's actually made of Catalogs in Blitz?

> However, this is where my problems start. I have no idea how to write a
> catalog for my program!! Can anyone help me here?
>
> One bloke has already asked for a "catalog.descriptor (.cd)" file for
> it. Yet I have no idea what he is talking about :-0 !!

It depends how you've done your strings in your program. If you used the
locale.library then you should already have a .cd, .ct and .catalog files
somewhere.

.cd is Catalog Description file
.ct is Catalog Translation file
.catalog is the one which holds all the strings for the different
languages.

But I guess you didn't do this since you don't know what a .cd file is :)
The simplest way to do multi-language support is to have a simple text
file, where each of the strings in your program is on a single line in the
file. When you start your program (or if the user chooses another
language) you can just read each line into a string array. Just make sure
all your strings in your program are accessed via the string array.

e.g.

#MAX_LOCALE = 1
Dim locale$(#MAX_LOCALE)

; Set up default strings here
locale$(0)="Hello, this is in English"

Statement ReadCat{language$}
SHARED locale$()
If(OpenFile(0,"PROGDIR:catalogs/"+language$))
i.w=0
While Lof(0)<>Loc(0) AND i<#MAX_LOCALE
locale$(i)=Edit$(256)
i+1
Wend
EndIf
End Statement

ReadCat{"francais"}
NPrint locale$(0)
ClickMouse
End

--------------------

Now, if you create a text file called francais and put some string at the
first line (which would be the French version of whatever the English
strings are), you have simple multi-language support.

(If you are running the program from inside the Blitz2 editor though,
you'll need to change the path to the file, since PROGDIR: will not work.)

Bye



[) /\ \/ ][ [) |\/| © |\/| ][ |\| |\| | dave@blitz-2000.co.uk
http://members.nbci.com/david_mcminn | ICQ = 16827694
Ignore this email and I'll summon Satan all over your hard drive!

---------------------------------------------------------------------
To unsubscribe, e-mail: blitz-list/-unsubscribe@netsoc.ucd.ie
For additional commands, e-mail: blitz-list/-help@netsoc.ucd.ie