[translations] please debug autolocale - batch imports

Gabor Hojtsy gabor at hojtsy.hu
Thu Apr 12 22:02:33 UTC 2007


Jakub Suchy wrote:
> Hi,
> i am trying to do something about batch operations with autolocale for
> drupal 6.x-dev.
> Nowadays, i have somehow working module, which does something, but has
> one big bug and tons of needed tweaks.

What was that big bug? It was not clear from the text.

> Please test this.
> This is related to: http://drupal.org/node/127539 - progressive
> operations in Drupal which we need for autolocale.
> 
> You can find my version of Autolocale here:
> http://sestka.drupal.cz/modules/autolocale/autolocale.install.phps
> http://sestka.drupal.cz/modules/autolocale/autolocale.phps

I grabbed your code and the batch patch. First cleaned up your changes 
and applied the latest autolocale changes to them. Then cleaned up the 
batch processing patch, and submitted that as a new version. Then 
comitted the cleaned up version of your autolocale version to autolocale 
HEAD.

> I am not making this as a patch to autolocale yet, because it's not
> ready (It's hell not ready. It's a proof of concept). There are too many
> bad paths, notices, strange things.  My autolocale is little bit updated

I also submitted two notice fixes for Drupal 6 along the way. 
http://drupal.org/node/135846

> for 6.x (working menu, skipping duplicate checks for development phase.
> You can find it under site building -> automatic import.

Left the menu item there, but given a more clean name and description to it.

> Try putting some .po to modules/system/po/system-module.LANGCODE.po and
> then try importing. It works. But when importing many files, it just
> don't import anything. But _locale_import_read_po() is called and it
> opens all needed files.

I did not notice this problem, all files were imported seemingly. I have 
around 1700 string imported from 17 files.

> Please note that:
> 1) Menu is somehow cached in 6.x. You will not see changes after
> importing in menu. Look for some hook_help() texts to see if import was
> succesful.

menu_rebuild() could help, although I did not put this yet into the 
updated code.

> 2) batch operation writes "0 processed" after doing the work.
> everytime...

This was due to you checking for count($results), while the batch API 
itself does not put anything into $results. The batch callback should 
put something there, as it gets a reference to that array. Once I added 
something to that array, count($results) was fine at the end.

Gabor


More information about the translations mailing list