[REBOL] Re: locale Re: Re: %Maoww_english.r
From: rebolek:seznam:cz at: 24-Aug-2002 12:36
----- Original Message -----
From: "Petr Krenzelok" <[petr--krenzelok--trz--cz]>
Sent: Saturday, August 24, 2002 12:07 PM
Subject: [REBOL] Re: locale Re: Re: %Maoww_english.r
> Carl Read wrote:
> >Let's. (:
> >A script's header is supposed to contain its file-name, so joining
> >that (minus the .r) to the user's language name would be the way to
> >get the file-path.
> >Maybe the language definitions should be an object? ie, create the
> >default so...
> >locale-words: make object! [
> > menu-item-1: "Open..."
> > menu-item-2: "Close"
> >and then if there's a file to over-ride the default, just load it
> >locale-words: make user-locale
> >user-locale being a block of set-word!/any-type! pairs. That'd have
> >the advantage of keeping any default words that were missing from
> hmm, that's the question of using block vs. object. if you use object -
> you define words. Block offer more dynamic aproach imo:
> locale-words [menu-item-1 "Open..."]
> few handlers could be defined as well - remove-locale-item,
> add-locale-item, replace-locale-item or so ...
> but generaly - it is not probably so important, if it will be block or
> object ...
> Now let's say you use IOS - you centrally switch it to Czech language.
> So - each app should know somehow, it should try to use Czech language
> catalogue. How to do it?
> And also - versioning - reblets are changed dynamically - so, someone
> posts new reblet, containing new UI item. You switch to Czech language,
> but your catalogue is old, and item not found - will you a) stay with
> english (default) language b) use Czech (selected) one, and on missing
> items use default language, so e.g. new button will be in English, while
> other UI items will be in Czech?
I'm writing Castro (Red Commander) as localized. I've patched VID-styles so
they check for language in feel/redraw function and you can change language
dynamically while running that program.
But I'm still not sure how to organize different language versions. Now I use
this approach - before every string written in english is function 'translate
that checks for language and "translates" string. So, with new versions, if it
does not find translation for some string original string is used.
But on the other hand I must use function 'translate before every string.