Multilingual UI Switcher Kit
Enhance your Webflow site with a Multilingual Language Switcher Cloneable. Featuring 14 custom switchers and Weglot integration, this UI kit boosts accessibility and user experience. Improve global reach and user engagement effortlessly.
Categories
js library
Introducing a sophisticated language switcher UI kit designed specifically for Webflow users seeking to enhance their websites with multilingual functionality. Developed by Finsweet, this cloneable tool is fully equipped to integrate with the Weglot translation service, enabling effortless multilingual support in mere minutes.
This cloneable features 14 custom language switchers, each powered by intricate Webflow Interactions, ensuring that users can seamlessly integrate them into their existing designs. By utilizing these switchers, Webflow users can easily broaden their audience reach, making their content accessible to non-native speakers and enhancing the overall user experience.
The UI kit not only provides a visually polished set of language switchers but also comes with comprehensive video tutorials tailored for users at any skill level. These resources are invaluable for anyone looking to implement a multilingual strategy while ensuring that the user interface remains user-friendly and engaging.
Additionally, the underlying code utilizes essential JavaScript libraries like Html5shiv.js for compatibility with older browsers, ensuring no user is excluded, while also incorporating the Weglot API for real-time translation management. The custom CSS controls the display properties effectively, allowing for tailored visibility of language options depending on user interaction.
Ultimately, this Webflow cloneable empowers users to cultivate a more inclusive online presence, improve accessibility, and potentially boost international traffic—all while enhancing site aesthetics and functional performance. Implementing this kit not only streamlines the translation process but also elevates the website's professionalism and user engagement, making it an essential addition for any Webflow project aiming for a global impact.
What does the CSS code in the Webflow project do with the .weglot-container class?
The CSS code sets the display
property of the .weglot-container
class to none
. This means that elements with this class will not be visible on the page. This can be useful for hiding language switches or translations provided by the Weglot translation service, especially if you want to control the display based on user interaction or other conditions.
How does the CSS class .a affect SVG elements in Webflow?
The CSS class .a
applies the fill
property to SVG elements using the value CurrentColor
. This means that the SVG will adopt the color of its parent element's text color. This is particularly useful in Webflow for maintaining a consistent color scheme across SVG icons and elements since you can use CSS to change the text color, and the SVG will automatically update to match.
What does the Weglot library do in the context of this JavaScript code?
Weglot is a translation management platform that enables multilingual websites. In this JavaScript code, Weglot is initialized multiple times with an API key, which enables language switching based on user selection. This allows the Webflow site to serve content in different languages, improving accessibility for a global audience. When Weglot initializes, it checks the current language and sets up appropriate event listeners on language links to enable smooth switching between languages.
How does the code handle language switching for multiple wrapper instances in Webflow using Weglot?
The code contains multiple instances where it initializes Weglot and sets up event listeners for language elements within different wrappers (e.g., .sw1
, .sw2
, etc.). Each block of code effectively checks for the active language and binds click events to language links. When a language link is clicked, it stops the default browser action and uses the Weglot API to switch to the desired language after a short delay. This approach allows different sections of the Webflow site to manage their language settings independently while maintaining a cohesive multilingual experience.
What is the purpose of the updateSWXDropdownLinks
functions in this code?
The updateSWXDropdownLinks
functions (where X is the wrapper number) are designed to update the dropdown toggle text and language attribute when the user switches languages. This ensures that the language selector reflects the active language correctly after a change. Each function accesses the appropriate .wg-element-wrapper
based on its number, checks whether the currently displayed language matches the user's selection, and updates the dropdown accordingly. This enhances user experience by ensuring that the interface reflects the selected language in real-time on Webflow sites.
Why is the use of setTimeout necessary when switching languages in this JavaScript code?
The setTimeout
function is used to create a delay before executing the Weglot.switchTo()
function. This delay allows any necessary UI updates or animations to complete before the language switch occurs, ensuring a smoother transition for the user. Delays like this can help prevent issues like flickering or unresponsiveness that may occur if the language switch is executed too quickly after a click action. This is particularly important in user interfaces built with Webflow, where visual clarity is key to maintaining user engagement.