1. PROMO Get 60% OFF Lifetime Pro Membership & access all our Pro Divi Extensions, Divi Layouts, Divi AI Generator, Divi Block, etc.VIEW PRICING
Dismiss Notice
UPDATE Custom Color Scheme + Premade Divi Layouts - A perfect combination to boost productivity. New 'Gadget Repair' layout added.Try our Custom Color Layouts
BEST Divi Block - A revolutionary drag & drop tool to easily mix & match 960+ premade blocks (Light & Dark) to kick start your Divi site design. Special module designs are included as well.
Learn More About Divi BlockFree Version ~ 340+ Free Blocks

Solved Divi Optin / Mailchimp German Presets

Discussion in 'Free Divi Community Forum' started by Stefanie Bayer, Jun 26, 2024.

  1. Stefanie Bayer

    Stefanie Bayer New Member

    Hey Divi pros - does anyone of you guys have an idea why I could have the following issue? I ran out of ideas.

    I included a Mailchimp Signup Form with the divi email Optin module - everything works great but the presets for the fields are in English only and not in German. I changed the names of the fields (where possible) in Mailchimp - nothing changed.

    AND - I would at one point need this to work in 3 different languages. I have no idea where / how to change this.

    See the screenshots for my configuration.

    Thanks for your help :)
     

    Attached Files:

    1. PRO MEMBER PERKS Divi.Help Pro Layout Packs - Agency Divi layout pack featuring modern overlay archive blog layout with hover effects:View Demo
  2. Divi Booster

    Divi Booster Divi Expert

    Hey Stephanie,

    The text in the fields are known as "placeholders". There isn't an option to change them in Divi and they aren't altered by the mailing list set up. But they are translatable, so you should be able to translate them using any of the WordPress translation plugins which exist. They will be listed under the "et_builder" text domain.

    Alternatively, you can translate them with PHP code as per this post:

    https://divibooster.com/change-the-divi-email-optin-module-placeholder-text/

    Hope that helps!
     
    Stefanie Bayer likes this.
  3. Stefanie Bayer

    Stefanie Bayer New Member

    Thanks Dan! Also thank you for the link. Can you point me in the right direction if I want to have different placeholders for different languages? I will have EN, DE and FR on the website. I wasn't successful finding an answer on Google so far...
     
    1. PRO MEMBER PERKS Divi Login Customizer Plugin - Instantly beautify your Wordpress login page with 6 premade designs:Learn More
  4. Divi Booster

    Divi Booster Divi Expert

    You're welcome, Stefanie.

    Assuming you're using a translation plugin to provide the multi-language support, then that plugin will probably provide a PHP function that returns the current language. If you're able to let me know which plugin you're using, I can try and track it down. With such a function, it should be possible to modify the code to return different translations for different languages.
     
    Stefanie Bayer likes this.
  5. Stefanie Bayer

    Stefanie Bayer New Member

    Thanks for your help! I use Polylang as a translation plugin.
     
    1. PRO MEMBER PERKS Divi Block Pro - Premade horizontal timeline design for your Divi site without using any plugins:View Demo
  6. Divi Booster

    Divi Booster Divi Expert

    I haven't properly tested this, but replacing the "db_email_optin_translations" function in that post (keep the rest of the code) with something like this may work:

    Code:
    function db_email_optin_translations($translated_text, $text, $domain) {
    
        if ('et_builder' === $domain) {
       
            // Define translations for each language
            $translations = array(
                'en' => array(
                    'Last Name' => 'Last Name',
                    'Email' => 'Email',
                    'Name' => 'Name',
                    'First Name' => 'First Name'
                ),
                'de' => array(
                    'Last Name' => 'Nachname',
                    'Email' => 'E-Mail',
                    'Name' => 'Name',
                    'First Name' => 'Vorname'
                ),
                'fr' => array(
                    'Last Name' => 'Nom de famille',
                    'Email' => 'Courriel',
                    'Name' => 'Nom',
                    'First Name' => 'Prénom'
                )
            );
    
            // Get the current language code via Polylang
            if (function_exists('pll_current_language')) {
           
                $lang = pll_current_language('slug');
    
                // Check if translations exist for the current language
                if (isset($translations[$lang][$text])) {
                    $translated_text = $translations[$lang][$text];
                }
            }
        }
    
        return $translated_text;
    }
    It's using polylang's pll_current_language function to get the language code and using that to look up the translation in the array. Give me a shout if it doesn't do what you need and I'll set up a proper test of it.
     
    Stefanie Bayer likes this.
  7. Stefanie Bayer

    Stefanie Bayer New Member

    Works perfectly!!! Thank you so much :)
     
    1. PRO MEMBER PERKS Divi Mini Cart Pro Plugin - Instantly add 3 different types of mini cart to your Divi site:Learn More
  8. Divi Booster

    Divi Booster Divi Expert

    You're very welcome, Stefanie! All the best with the rest of the site and give us a shout if there's ever anything else you need help with :)