Making “Translation Please” (Part 1) – the Sheet -> Intermediate
Voiceflow updated their API Block and renamed it the Integrations Block. It is now much more powerful because, among other things, it can be used to read, update, create, and delete the data from/to ANY CELL in a Google Sheet.
That is HUGE to hobby skill writers like me who write Alexa skills for fun, and for those who are ‘just getting their feet wet’, and can’t afford to put any money into it until they prove they can make money writing skills!
I’d like to explain why this is such a big thing to me. I first ‘got the bug’ a few weeks after Alexa arrived in Canada, in December of 2017. At that time, I was lucky enough to find a company names Storyline (who later froze out most of their supporters and changed name to Invocable) that offered a drag and drop, block-oriented, way to make voice skills. As part of their approach, they had a block that would allow us to read any individual cell, but only in column one! That was great at the time, but very limiting. So being able to to read, update, create, and delete the data from/to ANY CELL in a Google Sheet really is a big deal!
I will assume that everyone has at least a rudimentary introduction to spreadsheets. They consist of vertical columns and horizontal rows. The rows are numbered: 1, 2, 3, etc. The columns are identified by letters: A, B, C, etc. This is what my finished Google sheet looks like.
It looks like I did a lot of work making this, but I didn’t! Originally, I was just going to have ONE cell for each language. Since ROW 1 is used for headings (so a human can read the sheet), ROW 2 was going to be the only data row. After I decided to make it a ‘real’ skill, i figured that at some point, more than one person would eventually try to use the skill at the same time. So, I decided on using 10 ROWs, and a random variable in the skill, so users’ requests (probably) wouldn’t overlap.
Column B was originally created as 10 blank cells. For each of the others, I used a simple cell formula. For FRENCH, I inserted the folowing in CELL C2.
That tells the CELL to automatically “calculate” (actually translate would be a better word) the translation of the text value in CELL B2. The second part says that it expects the ‘text’ in B2 to be in English (hence the “en”). The third parameter says that the translation will be in French (“fr”). Several of these codes (ISO code 639-1) can be found in Google sheet information, and all should be available from Wikipedia.
As soon as I finished entering text into B2, the French translation ‘arrived’ in C2. Then, I did the same for D2, E2, and F2 (using “es”, “it” and “de” as the language codes). Once that was finished, my original version of the sheet was done. To make 10 rows like this, all you have do is copy the row, by clicking in B3 and dragging the cursor to F11, and paste what you copied. Voila! Now you have 10 rows, each of which will translate what is typed into column B of that row into the other 4 languages.
Part 2 of this tutorial is available here now. It deals only with explaining how to use the Integrations Block for this project. Hope you liked the tutorial!