• Resolved Dave

    (@dvaer)


    Hi there,

    I’ve translated the plugin to Bulgarian with PoEdit, and created .po and .mo files, which I’ve uploaded to the plugin’s language directory here: /wp-content/plugins/frontend-reset-password/i18n/languages

    But when I open a page with the password reset form, the translations are not showing up, and everything appears in English.

    My page has the Bulgarian language tag set as follows: <html lang="bg-BG">

    And as far as I’m aware the translations have the correct text-domain as follows: frontend-reset-password-bg_BG.mo

    My site doesn’t have caching, and I’ve tried in a private window too.

    Can you help me troubleshoot this?

    Thank you for your help,

    Dave

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

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Wp Enhanced

    (@wpenhanced)

    Thank you for alerting us to this issue @dvaer

    Below is a bug fix for you

    function somfrp_load_lang() {
    // Determine the current locale (user-specific or site-wide)
    $locale = determine_locale();

    // Construct the path to the appropriate .mo file
    $mo_file = SOMFRP_PATH . "i18n/languages/frontend-reset-password-$locale.mo";

    // Attempt to load the .mo file
    if ( file_exists( $mo_file ) ) {
    load_textdomain( 'frontend-reset-password', $mo_file );
    } else {
    $lang_dir = SOMFRP_PATH . 'i18n/languages';
    load_plugin_textdomain( 'frontend-reset-password', false, $lang_dir );
    }
    }

    This should be placed in the frontend-password-reset/includes/somfrp-functions.php file and replaces:

    function somfrp_load_lang() {
    var_dump( get_locale() );
    $lang_dir = SOMFRP_PATH . 'i18n/languages';
    load_plugin_textdomain( 'frontend-reset-password', false, $lang_dir );
    }

    I’ll also make sure this code is added to the plugin too

    Thanks!

    Ben

    Thread Starter Dave

    (@dvaer)

    Many thanks Ben, I appreciate it 🙏

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

The topic ‘Translations not loading’ is closed to new replies.