• Resolved janez33

    (@janez33)


    Woo-Vipps Plugin Translation Loading Bug Report Issue Summary

    The plugin fails to load translations correctly because it uses an incorrect path when calling load_plugin_textdomain(). Problem Location

    File: payment/Vipps.class.php
    Line: 2382
    Method: after_setup_theme() Current (Incorrect) Code

    $ok = Vipps::load_plugin_textdomain('woo-vipps', false, basename( dirname( __FILE__ ) ) . "/languages");

    Problem

    • __FILE__ in this context is payment/Vipps.class.php
    • basename(dirname(__FILE__)) returns "payment"
    • This results in the path: "payment/languages"
    • WordPress looks for: wp-content/plugins/woo-vipps/payment/languages/woo-vipps-{locale}.mo
    • But the actual file is at: wp-content/plugins/woo-vipps/languages/woo-vipps-{locale}.mo

    Expected Behavior

    The plugin should use the correct path: "woo-vipps/languages" Fix

    Change line 2382 from:

    $ok = Vipps::load_plugin_textdomain('woo-vipps', false, basename( dirname( __FILE__ ) ) . "/languages");

    To:

    $ok = Vipps::load_plugin_textdomain('woo-vipps', false, basename( dirname( dirname( __FILE__ ) ) ) . "/languages");

    This goes up two directory levels (from payment/Vipps.class.php to woo-vipps) instead of one. Impact

    • All translations fail to load (plugin shows English text regardless of WordPress locale)
    • Affects all locales (da_DK, sv_SE, nb_NO, fi, etc.)
    • Users see untranslated strings like “Please wait while we are preparing your order” instead of localized versions

    Verification

    Translation files exist at the correct location:

    • woo-vipps/languages/woo-vipps-da_DK.mo
    • woo-vipps/languages/woo-vipps-sv_SE.mo
    • etc.

    But plugin tries to load from:

    • woo-vipps/payment/languages/woo-vipps-da_DK.mo ✗ (doesn’t exist)

    Test Case

    1. Set WordPress locale to da_DK
    2. Navigate to Vipps express checkout page
    3. Expected: “Vent venligst mens vi forbereder din ordre”
    4. Actual: “Please wait while we are preparing your order”

    Plugin Version

    Tested on: 5.1.1

Viewing 1 replies (of 1 total)
  • Plugin Author Iver Odin Kvello

    (@iverok)

    Thank you for the bug report and analysis. This is ~ 1 year old and will affect users loading translations from the plugin instead of via translation files from translate.wp.org. The fix will be available in the next release.

Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.