From: osmith@acorn.co.uk (Owen Smith)
Newsgroups: comp.sys.acorn
Subject: Re: I18N and OS's (Was Re: Personal Computer World)
Date: 15 Apr 92 12:54:00 GMT
Distribution: comp
Organization: Acorn Computers Ltd, Cambridge, England

In article <9204150133.AA04031@ucbvax.Berkeley.EDU> lithgow@usl.com writes:

>Out of a purely techinical interest (it's my job), what new I18N features
>does RO3 add? Can anyone tell me?

Gasp! Er - where do I start? A *VAST* amount of work went into doing
internationalisation for RISC OS 3. It's also one of the areas that isn't
finished in the A5000 version, and is one of the things we've been working
on. So if the time taken for RISC OS 3 to come out for standard machines
seems like a long time compared to the visible differences, remember that a
lot of non visible (and non UK relevent) work has been done.

>Does RO3 provide any these facilities:
>
>1) A collation table for each locale.
>2) A character type table for each locale.
>3) A table specifying number handling for each locale.
>4) A table specifying monetary number handling for each locale.
>5) A table specifying the date and time formats for each locale.

Yes to all of these - you write a territory module (eg. the UK module) which
declares itself to the TerritoryManager module. Some of the above things are
done as tables (character properties etc.) for some of it you have to write
code (collation, time and date).

The number handling is a sod to use though - the application gets given a
load of bits saying where minus signs go, whether things are in brackets or
not etc. and the application writer has to write code to actually do it -
daft if you ask me. Should have been done such that you pass a number (or
string) in and get a formatted string out. The chances of all applications
doing it correctly and consistently are approximately zero.

Also the ShardedCLibrary locale stuff uses the TerritoryManager. So if you
go setlocale(LC_ALL, "") at the start of main(), all the locale functions
such as strcoll() use the current territory. 

>6) The ability for the user to change to different messages, simply by
>changing the language, rather than having to physically replace the file.
>(Applications can already do this, if they store a message file for each
>language, and then read the current language and use the appropriate
>file.)

No you have to replace the files. In RISC OS 3 almost the entire of the
stuff in ROM (including errors - new SWI MessageTrans_ErrorLookup) has a
Messages file. For most of the files in ROM you have to write a module that
declares the replacement file to ResourceFS. There are some that can be
pointed at disc files via a $Path, but that's not the recommended way of
doing it - they'll get loaded into the RMA anyway. You are basically
supposed to provide a new version of the Messages module.

>7) The ability for a user (not a programmer) to create a new locale, with
>all, or parts, of the above information.

Not a hope in hell. Doing a new territory is a job for a programmer. Doing
it without getting some source code from Acorn is going to be pretty tough.
The things you need source for most are BASICTrans, the UK territory module,
and keyboard driver code (a black art if ever there was one). In addition
you'll need code that isn't even in the UK ROM (and hasn't even been written
yet) to handle *HELP and Syntax errors - the hooks are there in the form of
service calls (Syntax not available in 3.00) but in the UK ROM nothing
claims the service so the default strings in the module headers get used.
You have to redefine all the filetypes set by FileSwitch and other modules
too since they aren't looked up.

WARNING. If you try to play with this stuff in 3.00 you are very likely to
get your fingers burnt. There are lots of things that don't work too well
and there is only so much you can achieve. Eg. loading a new module called
Messages causes the machine to go into an infinite loop. Change the name of
the module (to anything other than Messages) and it will be OK. You must
load everything before entering the desktop (this will not be changed).
Filer and Pinboard Templates windows can't be made larger (ie. more memory)
as the buffers are trimmed to the exact byte. Many of the Apps (including
the ROM ones) cannot have their names changed.

Owen.


The views expressed are my own and are not necessarily those of Acorn.