How to use the i18n.T function in i18n

To help you get started, we’ve selected a few i18n examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github wavebox / waveboxapp / src / app / src / Services / PDFRenderService.js View on Github external
.catch((err) => {
        if (err.message.toString().toLowerCase().indexOf('user') === -1) {
          dialog.showErrorBox(T('Printing error'), T('Failed to print'))
        }
        return Promise.resolve()
      })
      .then(() => { // Always
github wavebox / waveboxapp / src / app / src / Services / WebContentsRPCService.js View on Github external
_handleWillPreventUnload = (evt) => {
    const bw = BrowserWindow.fromWebContents(ElectronWebContents.rootWebContents(evt.sender))
    if (!bw || bw.isDestroyed()) { return }

    const choice = dialog.showMessageBox(bw, {
      type: 'question',
      buttons: [T('Leave'), T('Stay')],
      title: '',
      message: T('Do you want to leave this site?'),
      detail: T('Changes you made may not be saved.'),
      defaultId: 0,
      cancelId: 1
    })
    if (choice === 0) {
      evt.preventDefault()
    }
  }
github wavebox / waveboxapp / src / app / src / Services / PDFRenderService.js View on Github external
if (title === 'wbaction:print') {
            window.webContents.print({ silent: false, printBackground: false, deviceName: '' }, (success) => {
              this._pdfPrintCleanup(tmpDownloadPath, window)
              if (success) {
                resolve()
              } else {
                reject(new Error(T('Printing Error')))
              }
            })
          } else if (title === 'wbaction:error') {
            this._pdfPrintCleanup(tmpDownloadPath, window)
            reject(new Error(T('Printing Error')))
          } else if (title === 'wbaction:cancel') {
            this._pdfPrintCleanup(tmpDownloadPath, window)
            reject(new Error(T('User cancelled')))
          }
        }
      })
      window.loadURL(`file://${Resolver.printScene('index.html')}`)
github wavebox / waveboxapp / src / scenes / mailboxes / src / Scenes / SettingsScene / SettingsSceneContent.js View on Github external
const { showRestart, userIsLoggedIn, userEmail } = this.state
    const { classes, match } = this.props

    const tab = match.params.tab || 'general'
    const tabArg = match.params.tabArg

    return (
github wavebox / waveboxapp / src / app / src / Services / WebContentsRPCService.js View on Github external
_handleWillPreventUnload = (evt) => {
    const bw = BrowserWindow.fromWebContents(ElectronWebContents.rootWebContents(evt.sender))
    if (!bw || bw.isDestroyed()) { return }

    const choice = dialog.showMessageBox(bw, {
      type: 'question',
      buttons: [T('Leave'), T('Stay')],
      title: '',
      message: T('Do you want to leave this site?'),
      detail: T('Changes you made may not be saved.'),
      defaultId: 0,
      cancelId: 1
    })
    if (choice === 0) {
      evt.preventDefault()
    }
  }
github wavebox / waveboxapp / src / app / src / Services / PDFRenderService.js View on Github external
_injectPrintButton (wc) {
    wc.executeJavaScript(`
      ;(function () {
        const printButton = document.createElement('paper-icon-button')
        printButton.id = 'print'
        printButton.setAttribute('icon', 'cr:print')
        printButton.setAttribute('aria-label', '${T('Print')}')
        printButton.setAttribute('title', '${T('Print')}')
        printButton.addEventListener('click', () => {
          document.title = 'wbaction:print'
        })

        const toolbar = document.querySelector('#toolbar').shadowRoot
        const downloadButton = toolbar.querySelector('#download')
        downloadButton.parentElement.insertBefore(printButton, downloadButton.nextSibling)
      })()
    `)
  }
github wavebox / waveboxapp / src / scenes / mailboxes / src / Scenes / SettingsScene / SettingsSceneContent.js View on Github external
<div>{T('Wavebox Subscription')}</div>
                  <div>{userEmail}</div>
                
              ) : T('Wavebox Subscription')}
              className={classes.tabButton}
              value='pro' /&gt;
          
        
        
          {this.renderTab(classes, tab, tabArg)}
        
        
          <button color="{showRestart"></button>
github wavebox / waveboxapp / src / app / src / Services / PDFRenderService.js View on Github external
_injectPrintButton (wc) {
    wc.executeJavaScript(`
      ;(function () {
        const printButton = document.createElement('paper-icon-button')
        printButton.id = 'print'
        printButton.setAttribute('icon', 'cr:print')
        printButton.setAttribute('aria-label', '${T('Print')}')
        printButton.setAttribute('title', '${T('Print')}')
        printButton.addEventListener('click', () => {
          document.title = 'wbaction:print'
        })

        const toolbar = document.querySelector('#toolbar').shadowRoot
        const downloadButton = toolbar.querySelector('#download')
        downloadButton.parentElement.insertBefore(printButton, downloadButton.nextSibling)
      })()
    `)
  }