Internationalising BBC BASIC Applications ========================================= Instead of embedding English words and phrases into an application, you should really externalise all human language components. This allows you (or a user) to choose for themselves what human language the application communicates with them in. The principle is this. Instead of, for instance: PRINT "Exit program?" use: PRINT mExit$ where mExit$ has been set earlier in an initialisation routine. For English, this would be "Exit program?", but in, for example, German it would be "Program Beenden?". The easiest way to do this is to have a text file in the following format: ----8<---- Info:Info Quit:Quit Conv:Convert to Bas6:BASIC Text:Text ----8<---- and use the following messages routine: ----8<---- REM Message translation REM =================== DEFFNMessages_Rd(Country$) in%=OPENIN(@dir$+"\Resources\"+Country$+"\Messages.txt"):IFin%=0:=TRUE REPEAT A$=GET$#in%:IF LEFT$(A$,1)="#":A$="" A%=INSTR(A$,":"):IF A% THEN A%=A%-1:REPEAT:A%=A%+1:UNTIL MID$(A$,A%,1)<>" " PROCVar_Assign("m"+LEFT$(A$,A%-1)+"$",""""+MID$(A$,A%+1)+"""") SAVE UNTIL EOF#in%:CLOSE#in%:in%=0 =FALSE : DEFPROCVar_Assign(Var$,Val$) IF RIGHT$(Var$,1)="$":A%=EVAL("FNVar_S("+Var$+","+Val$+")"):ENDPROC ENDPROC : DEFFNVar_S(RETURN a$,b$):a$=b$:=0 ----8<---- An an appropriate point in the program initialisation you should do: failed%=FNMessages_Rd(language name) failed% will be non-FALSE if no messages file could be found. In this case you should load a messages file that you, the programmer, have supplied, for example: IF failed%:failed%=FNMessages_Rd("UK") This will set a load of variables with the names specified in the Messages file, prefixed with 'm'. With the above example, you would get mQuit$="Quit", mConv$="Convert to", mBas6$="BASIC", mtext$="Text". In the program itself you would use mQuit$ instead of "Quit", etc. Then, if the user decided to use a German Messages file mQuit$ would contain "Beenden", without the program having to be replaced. In the same directory as the application you need a "Resources" directory which will be searched for files for different languages. For example: MkIndex +---MkIndex.exe MkIndex executable +---Resources +---UK | +---Messages.txt MkIndex messages in UK English +---Germany +---Messages.txt MkIndex messages in German