TADA! Here is patch to fix most of the t() isssues in Drupal core.

 - Add the 'admin/system/modules#name' help section back in to provide the
   translated name of the module (used at various places)
 - Modified the _perm() hook to return an associative array with the permissions
   and their translated counterpart (since user module would translate the
   permission names anyway later on)
 - Modified the locale.module code to contain the date strings literally,
   making them available for .pot generation
 - Fix format_date() to only t() on components which are strings
 - Some other small bugs in tablesort.inc and archive.module

A highly recommended patch to make Drupal work with extractor.php.

Comments

gábor hojtsy’s picture

Assigned: Unassigned » gábor hojtsy
dries’s picture

I already committed a small subset of this patch.

gábor hojtsy’s picture

StatusFileSize
new38.45 KB

Yes, the few patched lines to tablesort.inc... Here is an uptodate patch then against current CVS.

gábor hojtsy’s picture

StatusFileSize
new38.45 KB

Ups, found a small typo, which needed correction in the patch.

gábor hojtsy’s picture

StatusFileSize
new2.92 KB

Since on IRC, I had been told that I'd better put the special case codes into extractor.php, I have put the date and format_interval() handling code to extractor.php (also extended the script to extract perm hook strings).

That means that from my big patch only the fixing in archive.module needs to be committed. I have also included a patch against locale.module that removes the admin init function that adds the initial date strings (since this is in the extractor.php code). That means that people using the regular translation methods will not see all the strings right away, but people use the .po way will see them (so far this was the other way round).

gábor hojtsy’s picture

Fixed in CVS, patch committed.

Anonymous’s picture