[REBOL] Re: R: Re: [REBOL]
From: petr:krenzelok:trz:cz at: 1-Feb-2002 9:39
Sorry if completly OT, as I don't follow the thread. So, are you trying to
do some easy localisation? If you are attempting to do "translation"
system, then I forget my post, but if the talk held here concerns
localisation system, here's my input:
I prefer simplicity. English is standard in Rebol syntax, so:
->> lang: 'cz
== cz
->> lang1: "cz"
== "cz"
->> blk: [cz 1 'cz 2 "cz" 3]
->> blk/:lang
== 1
->> blk/:lang1
== 3
Choose what you want. Now more complex example of usage:
;central IOS environment "variable" holding value
language: 'cz
; not necessary but possible .... select language-description 'cz (or even
more complex lang-spec object - national setting for currency etc.)
language-secription: ['cz "Cesky jazyk" 'de "Deutsche sprache"]
translated: [
months [
cz ["january" "leden" ....]
de ["january" "...." ....... ]
some-app [....]
]
;... you can check if some kind of an app is translated
; ... if find translated 'some-app ....
; .... or not error? try [translated/:myapp/:lang][app-locale: 'cz]
; if so,
->> app: 'months
->> select translated/:app/:app-locale "january"
== "leden"
... and if you don't like English as a default lang, you could just use
another aproach - it took me 3 minutes to organise above one :-)
-pekr-
Joel Neely wrote: