Confluence. Renaming Dialog Cancel button

I have a Dialog configured in atlassian-connect.json like:

{
        "url": "/dialogs/select-event?content_id={content.id}&outputType={output.type}",
        "options": {
          "width": "600px",
          "height": "300px",
          "header": {
            "value": "Select Events"
          }
        },
        "key": "select-event-dialog"
      }

And then it is rendered via JS script:

AP.dialog.disableCloseOnSubmit();

$(document).ready(function () {
    AP.dialog.getButton('submit').hide();
});

After all it has single button Cancel which I would like to rename to `Close``.

I have tried different ways including
AP.dialog.getButton('submit').textContent = 'Close';
But still no luck (

Does anyone know the way to rename that Cancel button to Close?

Thank you!