Customizing the language switcher
All switcher settings live in the dashboard and apply to your site as soon as you click Save Changes. You don’t need to touch the script on your site. Haven’t installed the switcher yet? Start with Adding the language switcher.
Placement
Section titled “Placement”Choose a Placement Strategy: Targeted Element (next to an element on your page), Fixed Top Right, or Manual (HTML Element). Adding the language switcher explains each option.
Behaviour
Section titled “Behaviour”Under Behavioral Settings:
- Remember preferences stores the visitor’s choice in their browser, so they keep their language on their next visit.
- Auto-detect language picks the language from the visitor’s browser settings when they haven’t chosen one yet.
- Native language names shows “Deutsch” instead of “German”.
Custom CSS
Section titled “Custom CSS”If the switcher doesn’t quite fit your design, open Advanced Layout Overrides and add Custom CSS (up to 2,000 characters). Your CSS only applies inside the switcher: SwiftLingo wraps it in @scope (.sl-wrapper), so it can’t affect the rest of your site.
You can style these classes:
| Class | Element |
|---|---|
.sl-wrapper |
The switcher’s container. |
.sl-dropdown-button |
The button that opens the dropdown. |
.sl-dropdown-content |
The list of languages in the dropdown. |
.sl-language-option |
One language in the dropdown. |
.sl-buttons, .sl-button |
The button-style switcher and its buttons. |
For example, to round the dropdown button and give it some space:
.sl-dropdown-button { background-color: #f3f4f6; border-radius: 8px;}
.sl-wrapper { margin-inline-start: 1rem;}Need something else?
Section titled “Need something else?”For a switcher that’s entirely your own design, see Building a custom language switcher.