On Sun, 21 May 2000, Francois Gouget wrote:
> On Sun, 21 May 2000, James Sutherland wrote:
> [...]
> > Perhaps we could take a leaf out of Acorn's book here: for I18N purposes,
> > their RISC OS contained a module called MessageTrans, which looked up text
> > tokens in a text file. You would call a lookup function with an argument
> > like this:
> >
> > lookup("RelocateFailed:Relocation failure - unable to relocate %0 due to
> > %1", filename, reason)
>
> I find this example very interesting. Note how it is different from:
>
> lookup("RelocateFailed:Relocation failure - unable to relocate %s
> due to %s", filename, reason)
>
> Just looking at german, english and french languages we can see that
> they all put words in a different order. So if internationalization is
> really the goal, then each '%xxx' must uniquely identify the parameter
> it refers to. In one language we may have '... %0 ... %1' and in another
> one '... %1 ... %0 ...'. Using '%s' just won't cut it.
Indeed. There are quite a few areas where Acorn were miles ahead :)
(With a program which used this facility, you only had to edit two files -
Messages, the dictionary, and Templates, which contained all the window
definitions - created with a WYSIWYG editor called FormEd. No need to
recompile, etc.)
> Of course this means that we would loose the gcc type checking as a
> side effect.
Yes - unless we define them to be strings at this point.
> I don't think it's worth internationalizing the TRACE/WARN/ERR at
> this point. I think we should focus on making sure the user sees as
> little of them. But then, if someone really wants to take on this huge
> task...
I'm going to need similar functionality for another reason anyway, so I'm
working on a library which does this.
James.