Comment 3 for bug 1527650

Revision history for this message
Doug Hellmann (doug-hellmann) wrote :

This library is just a wrapper around gettext. In "non-lazy" mode, gettext is invoked when the string is encountered in the code and the results can be cached. This supports translating to one language. In lazy mode, we delay translation until the last possible moment to give the user the language they specify when making their API call. The dynamic nature of that approach means we can't cache the results of the translation, and need to call gettext more often. And gettext is searching for the message catalogs each time because it is being initialized.

We could potentially save some number of gettext translation objects based on the domain and language/locale.