[Seaside] Re: [Pharo-users] i18n tools

Philippe Marschall philippe.marschall at gmail.com
Sat Sep 11 19:43:46 UTC 2010


2010/9/11 Panu Suominen <panu.j.m.suominen at gmail.com>:
> 2010/9/11 Philippe Marschall <philippe.marschall at gmail.com>:
>> I believe you can not get gettext from here [1].
> Why is that?

Dunno, ask Hilaire.

> Following code seemed to do the loading fine.
> Gofer new squeaksource: 'PharoNonCorePackages'; package:
> 'ConfigurationOfGettext'; load.
> ((Smalltalk at: #ConfigurationOfGettext) project version:'1.0') load.
>
> Couple of questions:
> 1) What is the preferred method to use variable content in strings? Is it:
>         'The time now is {1}' translated format: {Time now}

Variable content is not supported, that's mainly a Gettext issue. You
can use the above code but ignores the locale of the session, the
result will probably be a bit underwhelming

> 2) Is there already a plan to support above kind of parametrisation in Seaside?

Once Gettext supports it, yes.

> 3) Is there a way to translate magrittes validation errors?

Not out of the box. You'd probably have to customize Magritte error rendering.

> Does it seem good idea to create class that is going to be translated
> (but not yet is) and the translation
> is resolved later. For example when seaside's render: method is
> called. This way magritte errors
> could be transalted when they get rendered. Actually translated method
> could return this
> kind of objects and the resulting object's asString (printOn:) and
> renderOn: could do the actual
> translation

I don't quite follow.

> With same kind of idea one could also pass the arguments to the actual
> translation. For example
> t := 'The time is now {1}' translatedWith:{[Time now]}
> "in seaside:"
> html render: t
>
> Does this make any sense? Or is there already a better solution/plan?

Again, once Gettext supports it, I'd be happy to add support for it in
Seaside-Gettext.

Cheers
Philippe


More information about the seaside mailing list