views:

299

answers:

2

I get the following error when executing in Terminal the following command "cake extract":

Error: Class ExtractShell could not be loaded.

I have made sure that I'm in the right path and also all other commands I've executed work great like cake bake for example.

Do you have any ideas ...

A: 

Do you have the file /cake/console/libs/extract?

As far as I know, extract is only available in cake 1.3, are you using the beta? In 1.2 branch extract is not present.

Enrico Carlesso
Actually it is in /cake/console/libs/tasks/extract.php and yes I am using 1.3. What do you think is the problem?
ion
Oh, now I get. It's a task, not a shell extension, it means (afaik) that you have to use it in your own shell plugin. Take a look at i18n.php, it has a $task variable which hold "extract".But I really do not know how it should work...
Enrico Carlesso
Maybe, If I understand right, you have to use cake i18n with some special parameters to acheive what you used to do by cake extract...
Enrico Carlesso
I think you're right. i18n is the replacement of extract or at least what it is used to generate the pot files. However when I run the i18n I get the following error (several times): Undefined offset: 0 in /cake/console/libs/tasks/extract.php on line 129 and also on line 131. I'm not sure why I get that... if it rings any bells please let me know. Thanks
ion
A: 

Ok I think I got it.

First of all in cakephp 1.2 & 1.3 to create the pot files you need to execute the

cake i18n extract

However first the folders need to be created: app/locale/eng/LC_MESSAGES And inside each language folder the file default.po has to be available (even empty) Then cake generates a default.pot file which can be imported with poedit and then saved to generate the required .po and .mo files.

ion