This is the code that is being used, but this does not work for sites
using layouts as the $this->set('domain',...) only picks up the last
item that it is set to and not both.

Is there a way to get both to work? So the default layout which uses "-
layout-default.po" and the view to uses "-views-pages-display.po"

app/app_controller.php :
---
class AppController extends Controller {
...
var $domain = 'default';
...
function beforeFilter() {
...
$this->domain = 'default';
}

function beforeRender(){
...
$this->set('domain', $this->domain);
}
}

In app/controllers/xxx_controller.php :
class XxxController extends AppController {

function yyy($index = 0) {
...
$this->set('domain', '-views-xxxs-yyy');
...
}
}

In app/views/xxxs/yyy.ctp :
...
__d($domain, "SENTENCE_TO_TRANSLATE");
...

In app/locale/eng/LC_MESSAGES/-views-xxxs-yyy.po :
...
msgid "SENTENCE_TO_TRANSLATE"
msgstr "sentence translated"
...

In app/locale/fre/LC_MESSAGES/-views-xxxs-yyy.po :
...
msgid "SENTENCE_TO_TRANSLATE"
msgstr "phrase traduite"
...


On Sep 29, 5:35 pm, exo_duz <[EMAIL PROTECTED]> wrote:
> Seems like I found the solution at:
>
> http://bakery.cakephp.org/articles/view/p28n-the-top-to-bottom-persis...
>
> On the bottom of the page in Comments no. 26 it explains how to use
> multiple .po files.
>
> On Sep 29, 4:46 pm, exo_duz <[EMAIL PROTECTED]> wrote:
>
> > Dr. Tarique,
>
> > I have done that and have successfully made the default pot files from
> > the CAKE console script.
>
> > The only problem now is that it does not seem to pick it up on the
> > page. I have kept all the names the same such as "-app-views-pages-
> > default.po" and put all the files within /app/locale/eng/LC_MESSAGES
> > but the pages does not seem to be changing. Any ideas of the naming
> > conventions and structuring in the language folders?
>
> > On Sep 27, 1:44 pm, "Dr. Tarique Sani" <[EMAIL PROTECTED]> wrote:
>
> > > On Sat, Sep 27, 2008 at 10:03 AM, exo_duz <[EMAIL PROTECTED]> wrote:
>
> > > > Currently I am working with someone who isn't a programmer and I would
> > > > like to be able to structure the po files instead of just putting all
> > > > the translations in /app/locale/eng/default.po
>
> > > You can create .po files on per model, view,  controller basis
>
> > > try /cake i18n in the console and you will get an option to have a
> > > single .po file or multiple files...
>
> > > HTH
>
> > > Tarique
>
> > > --
> > > =============================================================
> > > Cheesecake-Photoblog:http://cheesecake-photoblog.org
> > > PHP for E-Biz:http://sanisoft.com
> > > =============================================================
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to