如何更改Google Apps脚本语言环境? [英] How to change Google Apps Script locale?

查看:92
本文介绍了如何更改Google Apps脚本语言环境?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Google帐户上创建了一个Google Apps脚本,该脚本在设置中设置了波兰语. 执行该脚本会导致一些Google错误消息,提示超出了波兰语中显示的Gmail rateMax报价.

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.

问题:如何更改Google Apps脚本的语言环境"?甚至有可能吗?

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?

推荐答案

如果您是从电子表格中创建脚本的-通过在Sheets UI中选择Tools --> Script Editor,然后在电子表格中执行setSpreadsheetLocale()应该会应用您的语言环境设置为脚本.

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.

这篇关于如何更改Google Apps脚本语言环境?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆