List Info

Thread: Stacking Translations




Stacking Translations
user name
2007-04-25 07:28:31
Hi

Just wanted to get some feedback on ways to stack
translations.

The scenario is we have one core Translation file - getText

This contains generic translation strings that are present
in all sites 
and modules

Want I want though is to then create a translation file with
specific 
site strings and then more with specific module strings.

so at any one time there will be three loaded translation
files

CORE always on

SITE - always on

MODULE - optional only when they enter module.

Anyone doing anything like this now, any gems of wisdom and
optimisation 
techniques I should be lookiing for.

Cheers

Ian

Re: Stacking Translations
user name
2007-04-25 07:49:11
Ok If I right a plugin:

     public function
preDispatch(Zend_Controller_Request_Abstract $request)
     {
         Zend_Debug::dump($request, null, false);

         // Setup the Language element
         $translate_module = new Zend_Translate('gettext',
'modules/' . 
$request->getParam('module') . '/locale/en.mo', 'en');
     }

How do I pass this new translation for use in the
controllers - or do I 
just register this in the registry and then call back?

Cheers

ian

Ian Warner wrote:
> Hi
> 
> Just wanted to get some feedback on ways to stack
translations.
> 
> The scenario is we have one core Translation file -
getText
> 
> This contains generic translation strings that are
present in all sites 
> and modules
> 
> Want I want though is to then create a translation file
with specific 
> site strings and then more with specific module
strings.
> 
> so at any one time there will be three loaded
translation files
> 
> CORE always on
> 
> SITE - always on
> 
> MODULE - optional only when they enter module.
> 
> Anyone doing anything like this now, any gems of wisdom
and optimisation 
> techniques I should be lookiing for.
> 
> Cheers
> 
> Ian
> 

Re: Stacking Translations
user name
2007-04-25 08:00:36
You could register it in Zend_Registry or you could do
$request->setParam() to assign the translation object to
each request.
The request object is available in all controllers.

On 4/25/07, Ian Warner <iwarnerdomainsregistry.net>
wrote:
>
> Ok If I right a plugin:
>
>      public function
preDispatch(Zend_Controller_Request_Abstract $request)
>      {
>          Zend_Debug::dump($request, null, false);
>
>          // Setup the Language element
>          $translate_module = new
Zend_Translate('gettext', 'modules/' .
> $request->getParam('module') . '/locale/en.mo',
'en');
>      }
>
> How do I pass this new translation for use in the
controllers - or do I
> just register this in the registry and then call back?
>
> Cheers
>
> ian
>
> Ian Warner wrote:
> > Hi
> >
> > Just wanted to get some feedback on ways to stack
translations.
> >
> > The scenario is we have one core Translation file
- getText
> >
> > This contains generic translation strings that are
present in all sites
> > and modules
> >
> > Want I want though is to then create a translation
file with specific
> > site strings and then more with specific module
strings.
> >
> > so at any one time there will be three loaded
translation files
> >
> > CORE always on
> >
> > SITE - always on
> >
> > MODULE - optional only when they enter module.
> >
> > Anyone doing anything like this now, any gems of
wisdom and optimisation
> > techniques I should be lookiing for.
> >
> > Cheers
> >
> > Ian
> >
>


-- 
Craig Slusher
cslushgmail.com

[1-3]

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