Adding a Language Switcher
Last updated
Last updated
Kalium supports multilingual websites through WPML, allowing you to add a language switcher in various locations. This guide covers how to add a language switcher in Kalium using WPML through three methods: Header, Widget, and Shortcode.
Kalium makes it easy to integrate a language switcher into your site's header. Follow these steps to enable the language switcher in the header:
Go to Appearance -> Customize.
Navigate to Header -> Other Settings.
Find the "Language Switcher" option and toggle it on.
Once you’ve enabled the language switcher, you can adjust its appearance and functionality to fit your site’s design.
Show Flag:
Choose whether to display flags for each language. Enable this option to show flags or disable it if you prefer not to use them.
Flag Position:
Select the position of the flags relative to the language names. You can choose to display flags on the left or right side of the language names.
Show Label:
Decide whether to display language names alongside the flags. Toggle this option to show or hide labels for the languages.
Label Format:
Choose how language names are displayed:
Native Name: Displays the language name in its native script (e.g., "Français").
Translated Name: Displays the language name in the language of the site (e.g., "French").
Initials: Shows language initials (e.g., "EN" for English).
Native Name (Translated Name): Displays the language name in its native script followed by the translated name (e.g., "Français (French)").
Translated Name (Native Name): Displays the translated name followed by the native name (e.g., "French (Français)").
If you are using a custom header, you'll need to manually add the language switcher element.
Please check the custom header article on setting on adding elements to your custom header and also the language switcher element article to see the available options:
To add a language switcher using a widget:
Navigate to Appearance -> Widgets in your WordPress admin panel.
Find the "WPML Language Switcher" widget in the list of available widgets and drag and drop the widget into your desired widget area (e.g., Sidebar, Footer).
Customize the widget settings as needed, including options for display style and language selection.
WPML also provides a shortcode to insert a language switcher into posts, pages, or any content area, add the following shortcode where you want the language switcher to appear:
You can customize the shortcode by following WPML's documentation for additional parameters and options. Edit the page or post where you want to add the language switcher and paste the shortcode to add it there.