The trouble with having a 'state-switch' button is that it can mean two things for the end-user:
the current state
what will happen when you click it
which can be confusing.
Please read this great article by the Nielsen Norman Group: "State-Switch Controls: The Infamous Case of the "Mute" Button" (https://www.nngroup.com/articles/state-...
The best practice is not to use a flag - flags are for nations, not languages. Many flags look alike or don't match the nationality of the user, which could be confusing.
Use a label of the language that the page is currently in, and provide links to switch to other options in their languages. In the example below, the current language is English (US). There ...