 
       [dialog, okButton, cancelButton, container, footer]
 
+    ###
+    Opens the localized welcome dialog
+
+    @return {Promise}
+    ###
     welcome: ->
       (__msg 'extName').then (extName) =>
         Q.all([

          (__msg 'welcomeDialogText', extName)
          (__msg 'welcomeDialogImageAlt')
          (__msg 'welcomeDialogImageHint')
        ]).then ([_title, _ok, _okTT, _cancel, _cancelTT, _ext, _imgAlt, _imgHint]) ->
          [dialog, okButton, cancelButton, container, footer] = @createDialog _title, [_ok, _okTT], [_cancel, _cancelTT]

          Text = _ext.replace /\n/g, '<br/>'
          imgSrc = ExtensionFacade.getURL 'shared/images/button_example.svg'
          container.append  """
                    <div class="#{M.CLS_WLCM_DLG}">
                      <img src="#{imgSrc}" data-tooltip="#{_imgHint}" alt="#{_imgAlt}" align="right">
                      #{Text}
                    </div>
                    """

          okButton.on 'click', =>
            [authDialog, authOkButton, authCancelButton, authContainer, authFooter] = @gettingStartedDialog()
            container.replaceWith authContainer
            okButton.replaceWith authOkButton
            cancelButton.replaceWith authCancelButton
            dialog.title authDialog.title()

            authOkButton.on 'click', =>
              @openAuthWindow {}
              dialog.close()
              return

            authCancelButton.on 'click', dialog.close

          cancelButton.on 'click', dialog.close
          dialog.open()

    gettingStartedDialogContent: ->
      extName = __msg 'extName'
      img = ExtensionFacade.getURL 'shared/images/authorize.svg'
      dialogText = __msg 'authorizeDialogText', extName
      dialogText = dialogText.replace /\n/g, '<br/>'
      """
      <div class="#{M.CLS_AUTH_TXT}">
        #{dialogText}
      </div>
      <div class="#{M.CLS_AUTH_IMG}">
        <img src="#{img}" data-tooltip="#{__msg 'authorizeDialogImageHint'}" alt="#{__msg 'authorizeDialogImageAlt'}">
      </div>
      """

    gettingStartedDialog: ->
      extName = __msg 'extName'
      [dialog, okButton, cancelButton, container, footer] = @createDialog (__msg 'authorizeDialogTitle', extName), [(__msg 'authorizeDialogButtonOk'), (__msg 'authorizeDialogButtonOkTooltip')], [(__msg 'authorizeDialogButtonCancel'), (__msg 'authorizeDialogButtonCancelTooltip', extName)]
      container.append @gettingStartedDialogContent()
      [dialog, okButton, cancelButton, container, footer]

    gettingStarted: (params) ->
      log 'showing getting started dialog'
      [dialog, okButton, cancelButton, container, footer] = @gettingStartedDialog()

      okButton.on 'click', =>
        @openAuthWindow params
        dialog.close()
        return

      cancelButton.on 'click', dialog.close

      dialog.open()

    openAuthWindow: (params) ->
      @getServiceUrl().then (url) ->
        url += M.SETUP_URL_SUFFIX

    ExtensionFacade.i18n key, substitutions, deferred.resolve
    deferred.promise

  currentEmailAddressDeferred = Q.defer()

  SERVICE_URL = 'https://api.mailfred.de'

