• I have an online store on WooCommerce with two languages, Russian (RU) and Ukrainian (UA), and plugins Polylang and LearnPress.

    When I am on the ‘personal account’ page, on the left side I have links: ‘Courses’, ‘Orders’, ‘Settings’, ‘Logout’. Clicking on these links works fine and everything displays correctly until I switch to the other language. Then I am redirected to the personal account page in the corresponding language where all labels are in the appropriate language, but the links on the left side do not work correctly.

    The link descriptions change according to the selected language, but the links themselves do not change and remain the same as they were before the language switch. For example, if I have RU language selected and I enter the personal account and switch to UA language, I will be on a page with labels in UA language, but the links still lead to pages with RU language content.

    When I go to LearnPress General -> Profile Page settings and change the profile page to the Ukrainian language variant, the same issue occurs. When I am on the ‘profile’ page with UA language and switch the language to RU, the labels are in Russian, but the links lead to pages with Ukrainian content.

    Both versions of the ‘Profile’ page have the same shortcode [learn_press_profile]: UA: https://www.smarticle.pro/wp-admin/post.php?post=9428&action=edit RU: https://www.smarticle.pro/wp-admin/post.php?post=10159&action=edit

    I don’t know what to change and I think this is incorrect plugin behavior because I haven’t found the necessary settings.

    If you need login and password for access, I will send them to you via email.

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

Viewing 1 replies (of 1 total)
  • dano1999

    (@dano1999)

    Interesting to hear your issue right now. Funny enough (not funny, it’s frustrating) is that I have a similar issue. I am using languages English and French. When I’m on a Forum user’s profile as a signed in user, and click the language switcher. It redirects me to the default home page (instead of showing me the user’s profile Im viewing in French).

    I’m not sure why it is doing this issue, but I need to view the logs to see what error is forcing it to the default home page as a failsafe redirect.

    Currently I have a site using LearnDash, bbPress (Forum), and Polylang. I had to download LocoTranslate in order to make manual translations on strings on the Plugin level.

    For your issue, I had to solve the links not updating on my site too for a similar bug. What I did was update the theme function.php file with a custom verifier that would 1) check if the language was in X (X = desired language), 2) then verify that the user was logged in. From there I executed some Javascript to update a given id/class href target location for the tag. This way your labels will still translate (as they are doing) but you can manually change the URL href target to your desired location. Yes, it’s a bit crude/taxing on the loading time. But it works, and it is working fine for my project.

    if (get_locale() == ‘fr_CA’) {
    // check login
    //
    if (is_user_logged_in()) {

    /// Now We Edit the Class text and href
    ?>
    <script type=”text/javascript”>
    document.addEventListener(“DOMContentLoaded”, function() {
    var links = document.querySelectorAll(‘a.ct-button’);
    links.forEach(function(link) {
    link.href = “target link”; // New href
    });
    });
    </script>

    <?php
    }
    else{
    return “”;
    }

    }

    Something like this above should work when you implement it for each of your links you need to update. So in your case, I would use id’s and then update he target href accordingly. Hope this helps to some degree with your issue and I wish the best mate.

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.