Hi,

I too have a need for dynamic localization; I want the user to be able  
to choose among several localization languages dynamically, and really  
everything (button and view labels, error messages etc.) should be in  
the chosen language.

I think this possibility should be built-in in Weblocks (as it is in  
other frameworks, e.g. Plone).

So I tried to implement it. I chose cl-i18n as a starting point and  
did the following patches:

1. Bug fix to cl-i18n, which cannot handle more than one file in  
`generate-i18n-file' and has a too simple-minded `get-strings';
2. Enhancement of cl-i18n to handle more than one language at the time;
3. Patch of the `translate' function to return a function which is a  
closure over the global *localization-language*, and which, applied to  
a string (in the #!"..." reader macro), returns its translation;
4. Patch of `tree-to-commands' in cl-who to handle function results  
(namely the functions returned by `translate');
5. Numerous patches to Weblocks where I had to replace hard-coded  
strings by #!"..."'s. This gets still more involved when the strings  
are format strings, but it is doable.

All this does work, but it would be nice if I wouldn't have to patch  
Weblocks. If you are interested in the code I can post it here.

- Paul

>
> On Mon, Apr 27, 2009 at 03:22:34PM +0200, Jose San Leandro wrote:
>>
>> Hi,
>>
>> We're developing a Weblocks application, and we need all texts to  
>> be in
>> the proper language, i.e. based on Accept-Language HTTP header.
>>
>> What follows are the relevant parts of our approach so far:
>
> You'll want to look at http://blog.viridian-project.de/cl-i18n/ and
> http://search.cpan.org/~ferreira/Locale-Maketext-1.13/lib/Locale/Maketext/TPJ13.pod
>
> -Robin
>


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"weblocks" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/weblocks?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to