Weglot Integration & Custom code

Hi there, I’m Alex from France, building a B2B marketplace MVP for electronic industry.

I’m actually setting up a multilingual websites with Weglot.

Already set up automatic english translation.

But, How to change the position of the language switcher in Softr ? Is it possible to put it in the Header ?
And how to put Country Flag a front the language switcher ?

There are some youtube videos to do it on different platforms, but not Softr.

I thank you in advance for your Help.

Merci beaucoup


Hi @Alex_Hexachip and welcome to the community!

I’m not familiar with the “language switcher” feature in WeGlot, but I’m going to guess from reading this support article that what you’ll want to do is put the Weglot Script in your site settings code, and then in the initialize() call you’ll want to change switchers.location.target to refer to a class that you’ll attach to a menu item in your Softr header, let’s call it weglotLanguageSwitcher.

To attach a class to a menu item in the Softr header, I think what you can do is create a link in the header and type raw HTML into its title. For example, you might type something like <div class="weglotLanguageSwticher">Placeholder for language switcher</div>.

What I don’t know is what Weglot does with the element that has the class. If it simply replaces it or adds itself as a child, then you’ll be in business. If it does something else, you might have to play around with it some more.

Please try the above and let me know how far you get! If you get stuck, a screen recording of how far you got will help a lot.

1 Like