Context Menu Module

The module allows creating the item in the context menu where it’s possible.

Crowdin context menus:

  • Resources > TM > TM record
  • Resources > Glossary > Glossary record
  • Project home tab > Language record
  • Project > Content > Files > File record
  • Project > Content > Screenshots > Screenshot record
  • Project > Language page > File record

Crowdin Enterprise context menus:

  • Workspace > TM > TM record
  • Workspace > Glossary > Glossary record
  • Project home page > Language record
  • Project > Content > Files > File record
  • Project > Content > Screenshots > Screenshot record
  • Project home page > Language page > File record

Context menu item can open specified app module with additional context related to the selected record, or custom URL. There are following types of actions:

  • Open specified app module in a modal dialog (see Modal module)
  • Redirect to specified app module
  • Open custom URL in new tab

This module is available to all authorized users.

Context menu item shows specified module in the modal.

{
    "identifier": "application-identifier",
    "name": "New Cool App",
    "logo": "/app-logo.png",
    "baseUrl": "https://app.example.com",
    "authentication": {
        "type": "none"
    },
    "scopes": [],
    "modules": {
        "project-integrations": [
            {
                "key": "integration-module-key",
                "name": "New Integration",
                "logo": "/integration-logo.png",
                "url": "/path/to/integration/module"
            }
        ],
        "context-menu": [
            {
                "key": "context-menu-key",
                "name": "Name of Context Menu Item",
                "description": "Description of Context Menu Item",
                "options": {
                    "location": "source_file",
                    "type": "modal",
                    "module": {
                        "project-integrations": "integration-module-key"
                    }
                }
            }
        ]
    }
}

Redirect

Context menu item redirects to the specified module.

{
    "identifier": "application-identifier",
    "name": "New Cool App",
    "logo": "/app-logo.png",
    "baseUrl": "https://app.example.com",
    "authentication": {
        "type": "none"
    },
    "scopes": [],
    "modules": {
        "project-integrations": [
            {
                "key": "integration-module-key",
                "name": "New Integration",
                "logo": "/integration-logo.png",
                "url": "/path/to/integration/module"
            }
        ],
        "context-menu": [
            {
                "key": "context-menu-key",
                "name": "Name of Context Menu Item",
                "description": "Description of Context Menu Item",
                "options": {
                    "location": "source_file",
                    "type": "redirect",
                    "module": {
                        "project-integrations": "integration-module-key"
                    }
                }
            }
        ]
    }
}

New Tab

Context menu item opens a new tab with the URL: baseUrl/options.url.

{
    "identifier": "application-identifier",
    "name": "New Cool App",
    "logo": "/app-logo.png",
    "baseUrl": "https://app.example.com",
    "authentication": {
        "type": "none"
    },
    "scopes": [],
    "modules": {
        "context-menu": [
            {
                "key": "context-menu-key",
                "name": "Name of Context Menu Item",
                "description": "Description of Context Menu Item",
                "options": {
                    "location": "source_file",
                    "type": "new_tab",
                    "url": "/example/path"
                }
            }
        ]
    }
}

Properties

key

Type: string

Required: yes

Description: Module identifier within the Crowdin app.

name

Type: string

Required: yes

Description: The human-readable name of the module. Uses as Context menu text

description

Type: string

Description: A human-readable description of what the module does.
The description will be visible in the Crowdin UI.

options.location

Type: string

Required: yes

Allowed values: tm, glossary, language, screenshot, source_file, translated_file

Description: The location in UI where the context menu can be added.

options.type

Type: string

Required: yes

Allowed values: modal, new_tab, redirect

Description: The type of action this module will perform.

options.url

Type: string

Use it only with new_tab type

Description: Relative URL.

environments

Type: string

Allowed values: crowdin, crowdin-enterprise

Description: Set of environments where a module could be installed.
This parameter is needed for cross-product applications.

Was this article helpful?