How to change Google Apps Script locale?

戏子无情 提交于 2020-02-21 12:32:08

问题


I created a Google Apps Script on the Google account, which had the Polish language set in the settings. Executing the script was causing some Google error message about exceeding quote Gmail rateMax, which was displayed in Polish.

I shared this script with another account, where language was set to English in account settings. To my surprise, executing the script on the account where language was set to English, caused the error message to still appear in Polish.

Question: how can I change the 'locale' of the Google Apps Script? Is it even possible?

Or is the only option to create new script on the account with English locale, and copy over the code?


回答1:


If you created the script from within a spreadsheet -- by selecting Tools --> Script Editor within the Sheets UI, then executing setSpreadsheetLocale() on the spreadsheet should apply your locale setting to the script, too.

If you created the script as a new document from Drive, then your suspicion appears to be correct -- there is no user-visible locale setting for a Script Document, so you'll have to create the script with an English-locale account.

You can refer to the official documentation for more info.



来源:https://stackoverflow.com/questions/21467261/how-to-change-google-apps-script-locale

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!