Search code examples
jsongoogle-apps-scriptinternationalizationmanifestgoogle-workspace-add-ons

How to internationalize universalActions label in a Google Workspace Add-On


I set up a Gmail addon with an universalActions menu. The label should be defined by Session.getActiveUserLocale() in any way.

Since variables are not allowed in the manifest file (appscript.json) I have no idea how to do it.

I was looking around for solutions but it seems there are none. e.g. Localizing Google Add-ons

Localizing Google Add-ons


Solution

  • Since there does not seem to be a solution I removed the universalActions completely from manifest file appsscript.json.

    To get the menu in different languages I added it on each card.

    return CardService.newCardBuilder()
        .addCardAction(CardService.newCardAction()
          .setText('test').setOnClickAction(CardService.newAction()
            .setFunctionName('testfunction')))
        .build();