• Resolved Mateus Getulio Vieira

    (@mateusgetulio)


    Hello team, I hope you’re well.

    I’m reaching out regarding the ongoing issue with WooCommerce Stripe Gateway plugin and WordPress 6.7, where translation loading is triggered too early, causing PHP notices:

    [23-Apr-2025 18:17:41 UTC] PHP Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the woocommerce-gateway-stripe domain was triggered too early.

    I’ve seen that this issue was addressed in GitHub (Issue #3604 – https://github.com/woocommerce/woocommerce-gateway-stripe/issues/3604) and presumably fixed in version 9.4.1. However, I’m still experiencing this issue even after updating to the latest version.

    I’ve tried several approaches to fix this locally:

    • Changing the hook priority for loading translations
    • Adding checks before translation functions are called
    • Other standard approaches

    What finally worked for me was loading the translation file directly in the global scope at the beginning of the plugin file, before any functions are defined:

    // Initialize translations immediately, in the global scope
    // This runs before any functions or hooks
    require_once(ABSPATH . 'wp-includes/l10n.php'); // Make sure translation functions are available
    if (function_exists('load_textdomain')) {
        load_textdomain(WC_STRIPE_TEXT_DOMAIN, WP_LANG_DIR . '/plugins/woocommerce-gateway-stripe-' . determine_locale() . '.mo');
    }

    While this workaround is effective, I wanted to please check if:

    1. Is this still considered an open issue by the Stripe Gateway team?
    2. Would you consider my approach a valid temporary workaround?
    3. Is there a more recommended way to address this issue?

    Thank you for any guidance you can provide.

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

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi there!

    I understand your concern. I’ve activated the latest version on my site and I’m also able to replicate the issue on my end.

    I recommend submitting your comment on this GitHub thread as well:
    👉 https://github.com/woocommerce/woocommerce-gateway-stripe/issues/3604
    This will help bring the issue to the attention of our developers so they can consider reopening it and investigate further.

    Also, what you’re seeing is a warning, not an error message, we recommend setting WP_DEBUG_DISPLAY to false, unless you are actively troubleshooting another issue. This prevents notices from displaying and breaking some functionalities.

    For troubleshooting or development environments where notices are filling logs, you might want to temporarily suppress these notices with the following snippet:

    add_filter( 'doing_it_wrong_trigger_error', '__return_false' );

    Thank you

    Thread Starter Mateus Getulio Vieira

    (@mateusgetulio)

    Hello Shahzeen,

    Thank you for confirming the issue still occurs and sharing that thread, I’ll go ahead and add a comment in there for future follow-up

    Best regards,
    Mateus

    Zee

    (@doublezed2)

    Hello Mateus Getulio Vieira,

    Thank you for your reply.

    I appreciate your contribution to the GitHub thread. Hopefully, our developers will notice your comment and provide some feedback about it.

    Please don’t hesitate to contact us again if you have more questions or concerns.
    We are here to help 🙂

    Best regards.

    Plugin Support Chris Moreira – a11n

    (@chrism245)

    I’m going to mark this as resolved, as we haven’t heard back from you in a while. Please open a new thread if you need further assistance.

    Your feedback is crucial for our continuous improvement and helps others in the community.

    Leave your review at: https://wordpress.org/support/plugin/woocommerce-gateway-stripe/reviews/

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

The topic ‘Translation warning persists in WooCommerce Stripe Gateway 9.4.1’ is closed to new replies.