[Seaside] Re: no HTML entities for 8bit characters in UTF-8 encoding

Kamil Kukura kamk at volny.cz
Fri Jun 25 10:20:09 CEST 2004


Avi Bryant wrote:
> I'd rather not use external XML files, since they don't integrate well 
> with Smalltalk source control.  The approach
> that I'm taking with CSS right now is to have simple StringLibrary 
> classes that consist solely of unary selectors returning string 
> literals.  I would think we could take the same approach here:
> 
> MyLocalLibrary>>buttonSend
>     ^ 'An Unicode text encoded in UTF-8'

Yes, I think it could be something generic. Right now I don't have clue 
how could I write readable unicode text into Squeak. But something 
derived from StringLibrary can have #doesNotUnderstand: implemented as 
gateway to reach translated text somehow.
Additionaly, I need external file as something I can pass to translator 
(a person) if I want to have it in another language. Anyway, I think it 
could be eliminated if there would exist seaside application for 
translating texts :)

>> However, I need one more method because I need handle cases such as:
>> html submitButtonWithText: (html getTextOf: #buttonSend)
> 
>
> I think we could adopt a convention like
> 
> html submitButtonWithLabel: #buttonSend
> 
> which would be equivalent to
> 
> html submitButtonWithText: (html textForLabel: #buttonSend)
> 
> where #textForLabel: was implemented to first try to use #buttonSend as 
> a localization key, and if it didn't find anything it would default to 
> splitting it into words, ie 'Button Send'.

It looks good, though I found so far just one collision: 
WAHtmlRenderer>>optionWithLabel:...

Regarding i18l text I'm thinking about relation with enumerated variable 
embedded somewhere in middle. Example in english (I hope it's correct):

    You have got 1 knife.
    You have got 2 knives.

In czech it has 3 possible forms:

    Mate 1 nuz.
    Mate 2(3,4) noze.
    Mate 5 nozu.

But together with date/time, currency formatting it is rather topic on 
data presentation in general.

-- 
Kamil


More information about the Seaside mailing list