Action Packages

You can create localized apps with the Actions SDK by creating separate action packages for each locale and then uploading them to your Actions project with the gactions tool.

To create localized apps with the Actions SDK:

  1. Create separate action packages for each locale that you want to support, giving them localized names such as action.de.json and action.en.json. Alternatively, you can create subdirectories in your project for your localized action packages and other resource files.

  2. Add the locale element at the top of your action package with the language or locale that you want to support. In addition, provide localized query patterns for your actions, so that users can trigger them properly for the locale they are in. For example:

    {
        "locale": "de",
        "actions": [
          {
    
            ...
    
            "intent": {
              "name": "actions.intent.MAIN",
              "trigger": {
                "queryPatterns": [
                   "insert german query patterns"
                ]
              }
            }
          }
        ],
    
        ...
    }
    
  3. Use the gactions tool to upload your action packages to your Actions project, specifying each of your localized action packages. For example:

    ./gactions update --project my-project-id --action_package action.de.json --action_package action.en.json --action_package action.fr.json --action_package action.ja.json --action_package action.ko.json