Here’s the source code to accompany this series of video tutorials:
http://community.thunkable.com/t/micro-tutorial-yandex/21698?u=domhnall
Start Up
When the app loads three lists are created, data are added to them and the list pickers are populated:
Show Flags
To reduce repetition, a procedure called showFlags
is created to grab flag images from countryflags.io. The flagFrom
and flagTo
variables will be updated every time the user picks a language from the list picker.
Pick Languages
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:
Source Code
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)