• Resolved Tii

    (@tii)


    The wp-activate page takes the default language and does not translate.

    If there are widgets, they will be duplicated in all languages.

    The page should be localized based on the cookie pll_language

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

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Chouby

    (@chouby)

    Hello,

    Plugins are not loaded on this page. So there is nothing I can do.

    Thread Starter Tii

    (@tii)

    is there a way to hack this ? I can change the wp-activate.php file in order to load polylang then ?

    Thread Starter Tii

    (@tii)

    I have been looking around and Polylang is actually loaded in that page!

    Thread Starter Tii

    (@tii)

    So, I searched for the solution.

    First, I needed to activate polylang on the Network (multi-site) level. This made it available to the wp-activate.php page.

    Then, I created a header-wp-activate.php file (copied from my theme into my child theme) and added these lines in the end of it:

    /**
     * @param $determined_locale
     * @return bool|PLL_Language|string
     */
    function set_locale_polylang($determined_locale) {
    
        if (function_exists('pll_current_language')) {
            return pll_current_language('locale');
        }
        return $determined_locale;
    }
    add_filter('pre_determine_locale', 'set_locale_polylang');
    
    load_default_textdomain();

    This fixed the issue

    • This reply was modified 4 years, 9 months ago by Tii.
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘wp-activate.php not translated’ is closed to new replies.