I want to add a button to my page that says "EN/PL" and when pressed it reloads the page with the other language (one button that performs PL -> EN or EN -> PL depending on current language selection). The problem is that I cannot find any way to query the current language settings so I cannot tell the program which language to switch to. I tried looking on hackage, hoogle and in the Yesod book and I could only find setLanguage, there doesn't seem to be a corresponding getLanguage function.
Is it possible to query the current language setting in Yesod or is there another way to implement a button like this?
I managed to solve the issue.
in pl.msg:
in en.msg:
And route that sets the language like in the book.
Then language preferences can be queries with