[development] Improving Drupal performance using native gettext for translations

Pedro Lozano peterlozano at gmail.com
Mon Jun 13 14:37:59 UTC 2011


Hi,

I'd like to know if anyone has ever experimented with making Drupal use the
php gettext extension to retrieve the string translations from a binary
gettext file (.mo)?

We have recently made a patch that allows Drupal to do this. We published a
blog post about it last week.

The pre-compile gettext file is created with "msgfmt -o messages.mo
drupal-es.po".

When you place it at sites/whatever/locale/es/LC_MESSAGES/messages.mo,
Drupal detects it and uses the gettext function to retrieve the translations
from the file.

It improves performance even in a clean Drupal install.

Of course you loose the flexibility of the string translating interface but
for sites with little changes to the translations and where performance is
key this helps with hardware resources and scalability.

This week we will be at Barcelona Drupal Days and for the code sprint we've
planned to make some kind of interface that allows you to generate the .mo
file directly from Drupal.

Could this patch be proposed for D8, D7, D6, Pressflow?



-- 
Pedro Lozano
peterlozano at gmail.com | http://peterlozano.com
pedro at al.quimia.net | http://al.quimia.net
+34 ( 667836318 | 956396515 )
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/development/attachments/20110613/1bb8688f/attachment.html 


More information about the development mailing list