That is great, but sometimes you need to manage it inside some more complex template.
In my case i had to show the flags just under my logo, cause using the widget i didn't get a great result.
Using the widget from the menu i got something like this:
As you can see using the widget with the Language Switcher, you can insert in the main menu, but the result is really ugly. So let's find something prettier.
I want to put my switcher just near the logo of my site.
To get this i modified some code.
Let's us see how to get this result:
Let'us start to study how works Polylang.
Polylang offers you a nice function called pll_the_languages, that accepts some parameters to personalize it.
I used a particular template by Colorlib, the template travelify.
I modified the file \wp-content\themes\travelify\library\structure\header-extensions.php.
<ul><?php pll_the_languages(array("show_flags"=>1) );?></ul>
<h1 id="site-title">
Just before the h1 tag.
Here the documentation for this function: https://polylang.wordpress.com/documentation/documentation-for-developers/functions-reference/
So your role now is to find the position where to show the flag, in relation with the template you are using and to put such code, this make you possible to position more accurate your switcher.