Complete the steps described in the rest of this page, and in about five minutes you'll have created a Google Slides add-on that translates text in your presentation.
Set it up
- Create a new Google Presentation.
- From within your new presentation, select the menu item Tools > Script editor. If you are presented with a welcome screen, click Blank Project.
- Delete any code in the script editor and rename
Code.gs
totranslate.gs
. - Create a new file by selecting the menu item File > New > HTML file.
Name this file
sidebar
(Apps Script adds the.html
extension automatically). - Replace any code in these two files with the following content, respectively:
translate.gs
sidebar.html
- Select the menu item File > Save all. Name your new script "Translate Quickstart" and click OK. The script's name is shown to end users in several places, including the authorization dialog.
Try it out
- Switch back to your presentation and reload the page.
- After a few seconds, a Translate Quickstart sub-menu appears under the Add-ons menu. Click Add-ons > Translate Quickstart > Start.
- A dialog box indicates that the script requires authorization. Click Continue. A second dialog box requests authorization for specific Google services. Click Allow.
- A sidebar appears. To test it, type some text into your presentation, then select it, and click the blue Translate button. To replace the text in the presentation, click Insert.
Publish
Since this is an example add-on, our tutorial ends here. If you were developing a real add-on, the last step would be to publish it for other people to find and install.
Learn more
To continue learning about how to extend Google Slides with Apps Script, take a look at the following resources: