Here’s the source code to accompany this series of video tutorials:
When the app loads three lists are created, data are added to them and the list pickers are populated:
To reduce repetition, a procedure called
showFlags is created to grab flag images from countryflags.io. The
flagTo variables will be updated every time the user picks a language from the list picker.
Because we’re using parallel lists we can use the
selection index to get the appropriate language code and country flag from their respective lists and the
showFlags procedure helps keep things neat and tidy.
Requesting a translation
When the Buttons is pressed these are the blocks we need to build a valid API request:
Handling the Response
When Yandex Translate sends us back a response then we can display it in the Label with the following blocks:
If you found this useful please consider liking this post or subscribe to my YouTube channel for more videos and examples like this.
yandex.aia (4.5 KB)