Opened 7 years ago

Closed 7 years ago

#27454 closed Cleanup/optimization (fixed)

Skip translation loading in apps that don't have a 'locale' directory

Reported by: Carl Meyer Owned by: nobody
Component: Internationalization Version: 1.10
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

For projects with many installed apps, most of which don't actually contain translations, a simple pre-check for existence of the app's locale dir before calling into gettext can save noticeable CPU time.

Change History (3)

comment:1 by Tim Graham, 7 years ago

Has patch: set
Summary: Gettext does a non-trivial amount of work when asked to load translations from a nonexistent directorySkip translation loading in apps that don't have a 'locale' directory
Triage Stage: UnreviewedAccepted

PR. Claude, what's your opinion about whether or not to try to add a test?

comment:2 by Claude Paroz, 7 years ago

I wouldn't be shocked if no tests are added for this optimization…

comment:3 by Tim Graham <timograham@…>, 7 years ago

Resolution: fixed
Status: newclosed

In 7107b6ff:

Fixed #27454 -- Skipped gettext calls for apps without a locale dir.

Note: See TracTickets for help on using tickets.
Back to Top