Opened 6 years ago

Closed 6 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 Changed 6 years ago by Tim Graham

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 Changed 6 years ago by Claude Paroz

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

comment:3 Changed 6 years ago by Tim Graham <timograham@…>

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