Hi All,
I have been working on an automatic locale file import module, so that we can provide install profiles which automatically import the PO files for modules enabled, without any user intervention (turn on locale module, add language, file upload).
The alpha quality code works, imports all PO files I have thrown at it. I have left two debug messages in the code, because I experienced very interesting database behaviour while testing the code, and would appreciate your feedback.
Project here with CVS link: http://drupal.org/project/autolocale
My problem is that although I do a SELECT on the system table and go through that list sequentially I get:
# Handling themes/engines/phptemplate/phptemplate.engine # Handling themes/garland/page.tpl.php # Handling modules/system/system.module # Importing modules/system/po/general.hu.po # Importing modules/system/po/system-install.hu.po # Importing modules/system/po/system-module.hu.po # Handling themes/engines/phptemplate/phptemplate.engine # Handling themes/garland/page.tpl.php # Handling modules/system/system.module # Importing modules/system/po/general.hu.po # Importing modules/system/po/system-install.hu.po # Importing modules/system/po/system-module.hu.po # Handling modules/autolocale/autolocale.module # Handling modules/block/block.module # Handling modules/color/color.module # ....
Seems like it does go through the phptemplate engine, the garland theme and the system module twice. I have absolutely no idea why it would do this, since these appear in the database only once.
I would appreciate if someone would be able to test and provide tips. This module/install profile would invalidate the need to merge the smaller PO files used by translators and really only import needed strings finally. I am going to beta test the concept with the Hungarian translation if the above issue can be resolved.
Have a merry christmas, Gabor (who is now off to christmas dinner :)
On Sun, 24 Dec 2006, Gabor Hojtsy wrote:
I have been working on an automatic locale file import module, so that we can provide install profiles which automatically import the PO files for modules enabled, without any user intervention (turn on locale module, add language, file upload).
Project here with CVS link: http://drupal.org/project/autolocale
[...]
Seems like it does go through the phptemplate engine, the garland theme and the system module twice. I have absolutely no idea why it would do this, since these appear in the database only once.
The bug was that the name of my module and install profile was the same, so the module _install hook was called twice (once as the module's install hook and near the end of the install process as the install hook of the profile). Renaming the profile effectively solved the problem.
I have extended the functionality of the module to also provide the ability to wipe an existing language and import PO files from the server folders into the database for that language. I would very much appreciate UI suggestions, testing and such. I am already beta-testing the profile with the Hungarian translation.
You can read more here about the suggested new locale package format and how it works:
http://drupal.hu/english/node/7
Gabor