Jump to content

Optimising the Manual Language Switcher

Recommended Posts

Hello!

I have built a bilingual website (Traditional Chinese - English) following the tutorial by Brad Good, it seems to be working fine.

The only problem I am facing now is that the language switcher (top right corner) does look a bit strange as it floats in the air and is not within the navigation menu. Is there a way to include it as one of the element in navigation menu (for both desktop and mobile)? Thank you!

My site:
https://caper-grouse-df3p.squarespace.com/
pw: goodgood

Link to comment
  • Replies 4
  • Views 1.3k
  • Created
  • Last Reply

Top Posters In This Topic

In your Code Injection code, find this code

image.thumb.png.f20b715fff96e32dbcebfadac7b65819.png

change it to

/* SETUP LANGUAGE SWITCHER */
    $('.header-nav-wrapper').prepend('<div class="language"><a href="/zh/home" class="lang-zh"><span style="font-size:12pt;"></span></a> <a href="/en/home/" class="lang-en"><span style="font-size:12pt;">En</span></a></div>');

then add this to Website > Website Tools > Custom CSS

/* Desktop Language Position */
.language {
    position: static !important;
    margin-left: 2.5vw;
}
.header-nav-wrapper {
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
}

image.thumb.png.718bb2db42a9e7d67a81f5e8871f0c23.png

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
  • 8 months later...

Hi! I followed the same steps as @wilfie_8282 and successfully edited the language switcher (fr/en) on the desktop menu. 

the issue I have is that the language switcher is not appearing at all on the mobile site. Ideally I would like to have it within the hamburger menu (see photos) 

site: https://red-lily-hn45.squarespace.com/fr/accueil

pass: tuan

I've already reached out to @tuanphan but if anyone else can help that would be great! merci! 

Screen Shot 2024-05-17 at 12.12.23 PM.png

Screen Shot 2024-05-17 at 12.13.18 PM.png

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment


×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.