Hi!
Is this the widget which does not work?
When using 'pll_the_languages', you must output the js yourself as stated in the topic you linked above. Since the, the code has changed a bit. So the exact copy won't work but comparing the code with what is currently in the widget (what you copied in your second post) should allow you to adapt the code.