1

I am debugging (what started as) a legacy add-on for Forms (migrated from the Chrome Web store, but now has its own Google Cloud Project) that was created by a colleague who speaks French. I'm testing it using the Test as add-on... feature.

The Stackdriver messages are showing up in French, e.g.:

2020-02-03 14:43:13.294 EST
Vous ne disposez pas de l'autorisation nécessaire pour effectuer cette action. at onOpen(Code:26)

Although I'm able to understand the error, I'm wondering how it got set to be French and how I can change it to English? Where is the setting for the locale (language) of Stackdriver errors? I could not find anything obvious in console, script, or the Google document containing the script. My Google locale (for my accounts) is set to English.

Edit: This is a Forms add-on, and there is no API that I could find to do something like setSpreadsheetLocale(). For this reason, it is not a duplicate of How to change Google Apps Script locale?.

Edit2: I created a new Google Form and a new "script" with clasp create ... and pushed all the same files. The errors are now in English. My assumption is that the locale is "stuck" to the script project. I can see no way to change it.

Rubén
  • 34,714
  • 9
  • 70
  • 166
Fuhrmanator
  • 11,459
  • 6
  • 62
  • 111
  • @Kos it's almost a duplicate, were it not for Google Cloud Stackdriver being the platform now. Unfortunately, there is no equivalent of the script locale for `FormApp` that I can see, so the answer is not applicable. I am using `clasp` for development, so I could try a fresh project to see if it resets the locale. But it's still a lot of work. – Fuhrmanator Feb 04 '20 at 03:14
  • @Fuhrmanator It may be using the locale of the user who installed the trigger. If so, you'll want to delete that trigger and re-install it (assuming your user's language is English). – Diego Feb 04 '20 at 04:07
  • @Diego there are no triggers for the project (under Edit > Current project's triggers). I saw that there's an option in the manifest for [useLocaleFromApp](https://developers.google.com/apps-script/manifest/addons#Common.FIELDS.useLocaleFromApp). I can try that... – Fuhrmanator Feb 04 '20 at 04:17
  • @Fuhrmanator Ah sorry, I didn't internalize that it's an add-on. I'd look at the *publishing account* user's locale. You may need to re-publish the add-on with an updated owner. – Diego Feb 04 '20 at 04:35
  • @Diego it's not been published yet with the new project. I'm trying to get there, though. The old owner is not part of any of the new files (in terms of permissions or ownership). – Fuhrmanator Feb 04 '20 at 05:36
  • For better understanding, are you the one executing the code? Have you set up your google account locale to English? Could you re-deploy? – Raserhin Feb 04 '20 at 09:39
  • @Raserhin Yes, I'm the one debugging (executing). My Google locale (for my accounts) is set to English. I don't know how to "re-deploy". I test using "Test as add-on" https://developers.google.com/gsuite/add-ons/how-tos/testing-editor-addons – Fuhrmanator Feb 04 '20 at 16:29
  • Do you have access to the code. Maybe take a look at [Publish your add-on](https://developers.google.com/gsuite/add-ons/how-tos/editor-publish-overview) – Raserhin Feb 04 '20 at 16:32
  • @Raserhin I seem to have fixed the problem by creating a new script project (see Edit2). This is problematic since I'm on the middle of an add-on review process and I'm not sure how easy it can be to "swap" the script ID now. It would be better if I could just change the locale of the existing project. – Fuhrmanator Feb 04 '20 at 18:09

0 Answers0