new gettext package

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

new gettext package

hilaire
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: new gettext package

Stéphane Ducasse
Excellent!
We should decide if we want to maintain it or not.
Then we can create a package for it.

Stef

On May 7, 2010, at 4:17 PM, Hilaire Fernandes wrote:

> I have uploaded a new version of the gettext package. I have removed a few classes used for the itnernal translator. So now, only gettext based catalog messages is used.
>
> Philipp, I have added a String>>translateTo: aLocale you can used from Seaside application.
>
> If we agree on that protocole, we can have in Pharo-Cire two String messages defined as follow:
>
> String>>translated
> "answer the receiver translated to the default language"
> ^ NaturalLanguageTranslator translate: self
>
> String>>translatedTo: localeID
> "answer the receiver translated to the given locale id"
> ^ NaturalLanguageTranslator translate: self toLocale: localeID
>
>
> Then a dummy class NaturalLanguageTranslator withn two class messages:
>
> NaturalLanguageTranslator class>>translate: aString
> ^ aString
>
> NaturalLanguageTranslator class>>translate: aString toLocale: localeID
> ^ aString
>
>
> NaturalLanguageTranslator class is redefined in the Gettext package.
>
> It should be possible to simplify the whole protocole after removing the LanguageEditor. This one is totaly unused, and it does not make sense to me to use Smalltalk to translated string, there are better third party tool to do that. Can I remove the LanguageEditor?
>
> Hilaire
>
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: new gettext package

Philippe Marschall-2-3
In reply to this post by hilaire
On 07.05.2010 16:17, Hilaire Fernandes wrote:
> I have uploaded a new version of the gettext package. I have removed a
> few classes used for the itnernal translator. So now, only gettext based
> catalog messages is used.
>
> Philipp, I have added a String>>translateTo: aLocale you can used from
> Seaside application.

Thanks, but I think I don't need it. I spent a bit of time hacking and
came up with a protoype [1] (Seaside-Gettext-Core and
Seaside-Gettext-Examples).

- I made a per request localization context that caches the domain,
locale and translator. That stuff now is only looked up the first time
you translate a string in a request. Because of this I can use
#translate:inDomain: directly.
- The domain is based on the application and not the class category of
the sender.
- The locale is first looked up on the session and then the request.
- I made a subclass of GetTextExporter that uses a custom
TranslatedReceiverFinder based on RB (thanks to Lukas "Wizard of RB")
that searches for my selectors.

I'll make a post to seaside-dev on how to use it.

I'm a happy camper now.

 [1] http://www.squeaksource.com/Seaside29Addons.html

Cheers
Philippe


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: new gettext package

hilaire
CONTENTS DELETED
The author has deleted this message.