User:JHernandez (WMF)/Translating a google form to other languages

The script only supports translating single page forms, so if you are doing a complicated multi-page form it may not work. By default it only does some special things for multiple choice questions, so if you have other types of questions besides multiple choice, inputs, or paragraphs, the script may need to be improved. More details at the end of this page.

Steps
First, make your form normally.

Then, note the ID, you can see it in the URL, it is the long string of gibberish characters. For example, in, the ID is.

Then, go to https://script.google.com/, make a new project, give it a name, and paste the following code: Once you have it there, you can put the ID at the beginning of the script on line 2, and you can try it out by selecting the function name  on the toolbar and clicking play.

It may take a bit to run, if there is an error it will show up on the UI, and you can check the logs to see what happened.

If everything went well you will see a new file in the same folder as the original.

Common errors
Too many languages, and questions, results in a huge form. You may get an error about the form size.

Also, the script only accounts for text inputs and paragraphs, and multiple choice questions, so if you have other types of questions, like lists, dates, etc., you may have to adapt the switch statement on line 136 to do the right thing.

Here is link to the google documentation that will help you figure out how to get into the question and its data to pass it through translation in the script: https://developers.google.com/apps-script/reference/forms/form