• Resolved elenafernandez

    (@elenafernandez)


    We’re translating a plugin with Loco Translate. We configured the OpenAi API with credit, and the plugin translated up to 67%. Afterwards, it keeps showing the following error:

    Error: cURL error 28: Operation timed out after 20002 milliseconds with 0 bytes received

    How can this error be solved?

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Tim W

    (@timwhitlock)

    You will have to extend your http_request_timeout. make sure you use a filter priority lower than 10 (higher number), because Loco Translate sets it to 20 seconds and you need to make sure your filter runs afterwards.

    OpenAI is slow when sending lots of data. You may have to set the timeout considerably higher, but bear in mind that your PHP process may timeout, so you may have to extend that also.

    Thread Starter elenafernandez

    (@elenafernandez)

    Ok, thank you so much.

    Extending the memory limit has worked for us.

    Regards.

    I am having the same problem with translating Paid Memberships Pro as well.

    Could you please give us the php code we have to put in functions.php to solve this?
    Or could you please update Loco translate to only translate batches each time? like we select the first 100 strings and let it do it, then save, then we select another 200 for example.

    Fatih ATES

    (@fatih24500)

    Hi @mdarwish313

    // Fix OpenAI timeout in Loco Translate
    add_filter('http_request_timeout', function($timeout){
    return 60; // Seconds (increase if needed)
    }, 99); // Priority MUST be >10

    // Optional: Increase PHP limits
    add_action('admin_init', function(){
    @ini_set('memory_limit', '256M');
    @ini_set('max_execution_time', '120');
    });
    danirodriguez

    (@danirodriguez)

    No soy capaz de traducir ni con deepl ni con open ia

    deepl me da este errror:
    Error: DeepL returned status 400: Value for ‘target_lang’ not supported.

    Open ia este:

    Error: Se ha interrumpido Loco por la salida de Unknown:0. Comprueba la salida de la consola para información de depuración

Viewing 5 replies - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.