5 – Widgets

  1. Polylang language filter
    1. Legacy widgets
    2. Widgets block editor
  2. Languages options
    1. All languages
    2. Choosing one language
  3. Polylang language switcher
    1. Language switcher with legacy widget
    2. Language switcher in block editor

1. Polylang language filter

1.1 Legacy widgets

Legacy widgets are the ones that were available prior to WordPress 5.8 (Appearance tab => Widgets sub-tab). They still work in WP 5.8 and beyond and can be accessed in the legacy widget block. You have the possibility to choose to display them for all languages (default setting) or only one language.

1.2 Widgets block editor

Since WordPress 5.8 widgets are now managed in the widgets block editor (Appearance tab => Widgets sub-tab). With Polylang Pro the language selector is also available in the block embedded view. As for the legacy widgets you can choose to display them for all languages (default setting) or only one language.

2. Languages options

2.1 All languages

Choosing “All languages” in the language dropdown means, as the option suggests it, that this particular widget will be available regardless of the language that is displayed. With this option  you will have the possibility to translate the title in the Strings translations option.

2.2 Choosing one language

Choosing to display a widget for one language (selecting a language in the dropdown list) implies that this particular widget will only be visible on pages and posts available in this particular language. Once the language is selected a flag is displayed on the left of the dropdown list (replacing the language icon) corresponding to the selected language.

3. Polylang language switcher

3.1 Language switcher with legacy widget

With Polylang you have the possibility to add our widget Language switcher (Appearance tab => Widgets sub-tab) by first adding a block “Legacy Widget” in which you then select the Polylang Language Switcher

3.2 Language switcher in block editor

With Polylang Pro comes a block allowing you to display a language switcher. Regardless of the chosen option(s), the block will only display a language if at least one post or one page has been published in this language. More about this block in The language switcher documentation.