• Daniil S.

    (@dscelectronicsde)


    Hi,

    today i noticed a strange problem and after disabling all plugins and themes except of Contact Form 7 and WooCommerce i can confirm that it is not related to any other plugin.

    Normally, the WooCommerce check out and Cart pages are completely in German, however if i enable Contact Form 7, a lot of strings are shown in Englisch. If i disable CF7, everything works again and is in German. How can that be? No PHP errors, nothing in the logs…

    Any ideas?

    Best Regards

    Daniil S.

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

Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Author Takayuki Miyoshi

    (@takayukister)

    In which part of the site do you see the issue?

    Thread Starter Daniil S.

    (@dscelectronicsde)

    Hi, in the Cart and Checkout process pages mainly.

    Br. Dan

    Plugin Author Takayuki Miyoshi

    (@takayukister)

    Where can we see those pages please?

    Thread Starter Daniil S.

    (@dscelectronicsde)

    Hi, please follow the steps below to see the effect. I will enable CF7 (temporary) so the translations are get affected by the problem.

    1. Visit: Wechselstrom-Labornetzger?t 0 … 300Vrms 0 … 25A 3kVA – DF-S5103 (laborance.de)
    2. Add the product to cart.
    3. Go to cart and follow to cheack-out.
    4. You will see that some texts are German, while some are Englisch.

    The website’s original language is German, and as i said if i disable CF7 everything is in German, while if i enable CF7 some terms are translated to Englisch. This is not affected by any other plugins or themes, as i tried disabling them all except for WooCommerce and CF7.

    If you have any questions, please contact me!

    Plugin Author Takayuki Miyoshi

    (@takayukister)

    OK, I found it.

    So, what is the difference between fields in German and fields in English?

    Perhaps it will be useful to you. The issue occurs if the form is created in another language. After the form is displayed, the localization of the site changes to the one specified in the form and half of the page template that is displayed after the form ceases to be translated into the current language.

    Localization switching takes place here;

    /wp-content/plugins/contact-form-7/includes/l10n.php (line 141)

    I also faced this problem with elementor. in the pages that have a form, the elementor editor page displays in english and in other pages that do not have a form the elementor editor displays in persian which is correct language.

    as @astronim pointed I also confirm that my forms are at en_US locale and my Website is in fa_IR locale and when I changed my forms locale to fa_IR from database the problem solved. So the form locale replaces the whole website locale.

    Thread Starter Daniil S.

    (@dscelectronicsde)

    Dear Takayuki,

    thank you for your confirmation, but i don’t quite understand the question. As from your reply i see that you supposedly found the cart and saw that partially the cart is shown in Englisch, partially in German. The problem is, it should all be German – which it is, if i disable CF7. The problem seems to be exactly what the commenters “astronim” and “vr2008” described which from my point of view is a terrible design decision – no plugin, especially one that has actually nothing to do with translations, should be allowed to mess with the front end language in any way.

    To “astronim” and “vr2008”, thank you guys, this was of huge help!

    Best Regards

    Dan.

    Thread Starter Daniil S.

    (@dscelectronicsde)

    @vr2008 Could you kindly point me to the right location in the database to change my forms locale? Thanks in advance!

    @dscelectronicsde I’m glad I could help.

    I used phpmyadmin search feature to find the rows that had my forms locale which was en_US. It found the rows in wp_postmeta table with the post_id that matched my form’s ID. so I changed the value to fa_IR and problem solved.

    but the real problem as you mentioned is that the plugin should not mess with translations.

    • This reply was modified 1 year, 11 months ago by vr2008.
    • This reply was modified 1 year, 11 months ago by vr2008.
    Thread Starter Daniil S.

    (@dscelectronicsde)

    @takayukister Maybe you could add the possibility to change the locale of each contact form from the admin page even after creation of the form?

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Contact Form 7 messes translations up’ is closed to new replies.