Support » Plugin: Multilingual Contact Form 7 with Polylang » Theme strings only apply after second page refresh.

  • Resolved Azragh

    (@azragh)


    Hello =)

    I used this plugin to set up a multilingual contact form (de, en, fr, es & ru) on https://world-mts.com – now I noticed that the theme strings no longer work when changing the language in combination with this plugin. They are only adopted after reloading the page (can be observed in the two buttons of the top bar).

    Funnily enough, the last selected language is always taken – if I switch from French to English, the theme strings remain French. If I then change to Russian, they change to English etc, depending on what was last selected..

    Exactly the same page, but without activated plugin: https://ntd-testumgebung.ch/mts. Here everything works as expected.

    As I don’t want to maintain 5 individual contact forms, I would appreciate a little help 😉

    (Translated from German with http://www.DeepL.com)

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

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Andreas Münch

    (@andreasmuench)

    Hi @azragh ,

    thanks for your report.
    It seems this is the same issue as reported here: https://wordpress.org/support/topic/issue-with-date-translation/

    I´ll look into this as soon as possible.

    But please note that this would probably not a big issue in general, as the usual website user won´t switch from one language to another all the time 😉

    It needs a fix nevertheless of course.

    Thank you!

    Thread Starter Azragh

    (@azragh)

    Yep. Same issue. 😉

    No, it is indeed not a big problem. Unfortunately, due to another incompatibility, I had to deactivate Polylang’s automatic language recognition, so for the time being, foreign-language users end up on the German page – so they can observe the error at least one time / on their first visit.

    But all good for the moment, the customer also said it’s not so bad. It’s just me being a perfectionist. x)

    same issue here…

    In my case the mo files replaced by Messages_Translation::load_textdomain_mofile hook which is get PLL cookie, but the cookie is set at the end of request, so for lang-switch requests we have old cookie value so your hook replaces mo-filenames with previously active language.

    could you explain this hook’s comment?
    // whyever this does not work out of the box, especially in AJAX

    I think, such way to replace mo-filenames is not too good idea and can cause more problems later. Imho it is better to research the original problem(which “solved” by the hook) and try to solve it w/o such hacks. Could you describe the original problem plz so I can debug it or so…

    Thank you!

    tmp solution for my case is adding another hook:

    
            add_action('pll_language_defined', function ($slug) {
                $_COOKIE['pll_language'] = $slug;
            });
    
    Plugin Author Andreas Münch

    (@andreasmuench)

    Hey @aleksanderd ,

    yes, you´re right. That is a bit hacky and I´ll review this.

    Thank you!

    Plugin Author Andreas Münch

    (@andreasmuench)

    Hi @aleksanderd ,
    Hi @azragh ,

    please load the latest version 1.0.2 and check if there are still any issues.

    Thank you!

    Thread Starter Azragh

    (@azragh)

    No issues anymore. 😄

    Thank you!

    Plugin Author Andreas Münch

    (@andreasmuench)

    Thanks for your feedback! 👍

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Theme strings only apply after second page refresh.’ is closed to new replies.