Switch languages via App Text

Hi! I am creating one page app and I couldn’t set up a multi-language option for my app for a long time and I haven’t found any information anywhere. But eventually, I figured that out and want to share, maybe it will be helpful for someone.
So after you set up all the App text translations in Settings → Language and create actual buttons to choose a language, you need to create Option Set in the Database and call it Language, add some options (option=language), and attribute Code. Then go to each of your language attributes and write a code, e.x. en_es for English, uk_ua for Ukrainian etc.
After this, you go to Workflow of the first button of your first language and set up the following workflow:





Hope, this will help!