So, I’m doing an app where in the settings, there’s a option to change the language. It has only two languages: portuguese and english. The user select the language they want using a select box, where, when one is selected, the other one isn’t. Then, using a boolean variable (because are only 2 languages) I put it in portuguese if it’s false and in english if it’s true.
The problem comes when I try to use this variable in other screens, because for some why, it doesn’t get the updated value (I tried to print its value in other screen and it keeps always the default value).
What makes me even more confused is that I made a light/dark theme using the same method and it is ok.
Here are the blocks of the settings screen:
Here are the blocks of the other screen:
NOTE: The functions “temaClaro” and “temaEscuro” are the dark and light mode. As I said before, it’s working well.
The functions “idiomapt” and “idiomaen” are the ones that aren’t working
The variable “idioma” is the boolean one that has the information of which language it will have.