Performance improvement for importing of project translations

Created on 14 August 2019, over 5 years ago
Updated 29 April 2025, 13 days ago

Problem/Motivation

Currently importing of .po files for projects could take unacceptable about of time.

Proposed resolution

I have found that problem related to implementation of locale_translation_status_save();
This could be solved by this changes:

 function locale_translation_status_save($project, $langcode, $type, $data) {
   // Load the translation status or build it if not already available.
   module_load_include('translation.inc', 'locale');
-  $status = locale_translation_get_status();
+  $status = locale_translation_get_status([$project]);
   if (empty($status)) {
     $projects = locale_translation_get_projects([$project]);
     if (isset($projects[$project])) {

Remaining tasks

Don't see for now.

User interface changes

No changes

API changes

Data model changes

Release notes snippet

🐛 Bug report
Status

Fixed

Version

9.4

Component

locale.module

Created by

Live updates comments and jobs are added and updated live.
  • Performance

    It affects performance. It is often combined with the Needs profiling tag.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇩🇰Denmark uv516 Denmark

    I am using Drupal 10.4.6 and patch #22 is implemented.
    Despite that, the site still takes a VERY LONG time to search and save translations.

Production build 0.71.5 2024