I am running a symfony 1.3.0 Beta (last checkout this morning), and it seems
that the i18n database support is down on mysql.
I have this config in my factories.yml
i18n:
class: sfI18N
param:
default_culture: en
database: mysql://root:my_passw...@localhost/my_database
source: MySQL
debug: false
untranslated_prefix: "[T]"
untranslated_suffix: "[/T]"
cache:
class: sfFileCache
param:
automatic_cleaning_factor: 0
cache_dir: %SF_I18N_CACHE_DIR%
lifetime: 31556926
prefix: %SF_APP_DIR%/i18n
and so, i have started run the command
symfony i18n:extract frontend en
and got a lot of :
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result
resource in
/media/disk1/symfony/branches/1.3/lib/i18n/sfMessageSource_MySQL.class.php
on line 275
I have fixed this by commenting the implementation of the "__destruct"
method in my sfMessageSource_MySQL.class.php
// @mysql_close($this->db);
after that ... no warning occured
i have saw that is not sawing the results into the database, so i have run
symfony i18n:extract --auto-save frontend de
which has outputed
>> i18n extracting i18n strings for the "frontend" application
>> i18n found "70" new i18n strings
>> i18n found "0" old i18n strings
>> i18n saving new i18n strings
which again did not save anything into the database .
So, i have gone to the terminal and run
symfony i18n:extract --display-new frontend de
that had following output ...
>> i18n extracting i18n strings for the "frontend"
application
>> i18n found "70" new i18n
strings
>> i18n found "0" old i18n
strings
>> i18n display new i18n
strings
Get Help
....
after i have saw that i have gone in the save method, and i have added to my
first line of that method a die('a message'). which was displayed...
After several moves of a die function i have noticed that is failing in the
getCatalogueDetails method, on line 299, because i did not have any
catalogue in my database ...
So i have added :
INSERT INTO `catalogue` (`cat_id` ,`name` ,`source_lang` ,`target_lang`
,`date_created` ,`date_modified` ,`author`)
VALUES (NULL , 'messages', 'en', 'fr', '0', '0', 'alecs');
After that ... i have run again the task
symfony i18n:extract --auto-save frontend de
i have managed to fix this ... by altering my catalogue.name record to "
messages.de"
After that i have run again and the task and finally got 70 records in my
trans_unit database
Finally i have got it working but after i have lost around 2 hours..
what can i see now is:
- this is not documented ( I'll put together some doc about it ). There is
no db structure (only in sfMessageSource_MySQL.class.php php doc)
- this is pretty hard to configure it / figure out what is supposed to
happen
- there is no method to insert the catalogue name into the database - so, in
the first step, the user will be frustrated that doesn't know how to work
with... what records to fill in and so on ...
this is what i have finally after i have fixed the problem by my own ..
http://bemused.org/blog/2008/02/20/symfony-and-i18n/
Sorry for my long email.. but it was written while degugging the thing.
Alecs
--
As programmers create bigger & better idiot proof programs, so the universe
creates bigger & better idiots!
I am on web: http://www.alecslupu.ro/
I am on twitter: http://twitter.com/alecslupu
I am on linkedIn: http://www.linkedin.com/in/alecslupu
Tel: (+4)0748.543.798
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"symfony developers" 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/symfony-devs?hl=en
-~----------~----~----~----~------~----~------~--~---