List Info

Thread: Multi-lingual sites - language propagation




Multi-lingual sites - language propagation
user name
2006-07-27 08:12:59
Hi,

the solution given by Laurent and Simon does the job but I think it's not the role of the controller to retrieve language parameter. And if you have several routes with many, many parameters to match, it can become difficult to manage.
A solution is to do the job in the Router, you can had the following code just before (or after, you choose) remove RewriteBase to path variable in 'route' method in RewriteRouter:

 ;       switch ($path[0]) {
     ;       case 'fr_FR':
    ;        case 'en_GB':
    ;        {
       ;         $locale = array_shift($path);
    ;           ; setlocale(LC_MESSAGES, $locale . '.utf8');
  ;           ;   break;
        ;    }
     ;   }


Ludovic
Multi-lingual sites - language propagation
user name
2006-07-27 09:48:06

That was quite i did with first ZF router but with register
a plugins in 
bootstrap where the function routeStartup() alter query
before it was 
parse by router.
But since the rewrite router is available, i prefer avoid
plugins 
solution and manage it with router.

> Hi,
>
> the solution given by Laurent and Simon does the job
but I think it's 
> not the role of the controller to retrieve language
parameter. And if 
> you have several routes with many, many parameters to
match, it can 
> become difficult to manage.
> A solution is to do the job in the Router, you can had
the following 
> code just before (or after, you choose) remove
RewriteBase to path 
> variable in 'route' method in RewriteRouter:
>
>         switch ($path[0]) {
>             case 'fr_FR':
>             case 'en_GB':
>             {
>                 $locale = array_shift($path);
>                 setlocale(LC_MESSAGES, $locale .
'.utf8');
>                 break;
>             }
>         }
>
>
> Ludovic 
-- 

------------------------------------------------------------
---------
Sorry, This disclamer is auto added by FW's company
------------------------------------------------------------
---------







Si vous n'etes pas destinataires de ce message, merci
d'avertir l'expediteur de l'erreur de distribution et de
le detruire immediatement.
Ce message contient des informations confidentielles ou
appartenant a La Francaise des Jeux. Il est etabli a
l'intention exclusive de ses destinataires. Toute
divulgation, utilisation, diffusion ou reproduction (totale
ou partielle) de ce message ou des informations qu'il
contient, doit etre prealablement autorisee.
Tout message electronique est susceptible d'alteration et
son integrite ne peut etre assuree. La Francaise des Jeux
decline toute responsabilite au titre de ce message s'il a
ete modifie ou falsifie.

If you are not the intended recipient of this e-mail, please
notify the sender of the wrong delivery and delete it
immediately from your system.
This e-mail contains confidential information or information
belonging to La Francaise des Jeux and is intended solely
for the addressees. The unauthorised disclosure, use,
dissemination or copying (either whole or partial) of this
e-mail, or any information it contains, is prohibited.
E-mails are susceptible to alteration and their integrity
cannot be guaranteed. La Francaise des Jeux shall not be
liable for this e-mail if modified or falsified.
[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )