[Seaside] Re: no HTML entities for 8bit characters in UTF-8
encoding
Colin Putney
cputney at wiresong.ca
Sat Jun 26 03:58:58 CEST 2004
On Jun 25, 2004, at 4:46 PM, Avi Bryant wrote:
>
> On Jun 25, 2004, at 1:35 PM, Colin Putney wrote:
>
>> A while back I read a fascinating article on localization, but I
>> haven't been able to dig it up again. The one thing that stuck with
>> me though is the idea that localized strings should be functions, not
>> table lookups.
>>
>> So I suspect the right way to go about it would be to use no string
>> literals at all in the source code, but have method calls like:
>>
>> Localization youHaveKnives: 2.
>>
>> Strings that don't need to be parameterized can be unary selectors.
>> This lets all the different languages deal with their own
>> idiosyncracies correctly, while still giving a clean interface to the
>> programmer.
>
> Yeah, I think I said much the same thing when we were discussing
> Babel. IIRC, what I proposed then was something like
>
> String>>localized
> ^ self
>
> Symbol>>localized
> ^ Localization perform: self
>
> Localization>>localized
> self subclassResponsibility
>
> So you could still provide strings directly, or symbols to be looked
> up, or full objects that would do arbitrary things to come up with the
> right string.
Well, no. That's the opposite of what I suggested above.
Frankly I think that's too much flexibility. The whole idea of what I
proposed above is *not* to have strings in the source code. If every
user-visible string is a message to a single localization object, it's
an easy bottleneck for translators to intercept, but still flexible
enough to handle the vagaries of diverse languages.
Colin
More information about the Seaside
mailing list