TacoTranslate
/
DocumentațiePrețuri
 
  1. Introducere
  2. Începeți
  3. Configurare și setări
  4. Folosirea TacoTranslate
  5. Redare pe partea de server
  6. Utilizare avansată
  7. Cele mai bune practici
  8. Gestionarea erorilor și depanare
  9. Limbi acceptate

Gestionarea erorilor și depanare

Sfaturi pentru depanare

When integrating and using TacoTranslate, you might encounter issues. It’s important to note that the default behavior of TacoTranslate is to just display the initial text whenever an error occurs. No errors will be thrown or otherwise break your application.

Typically, though, issues are very easy to resolve. Here are some useful tips to help debug:

Check console logs
TacoTranslate outputs debugging information when errors occur.

Inspect network requests
Filter requests by tacotranslate and inspect their output.

Utilizarea obiectului de eroare

TacoTranslate provides an error object through the useTacoTranslate hook, which can help you handle and debug errors. This object contains information about any errors that occur during the translation process, allowing you to respond appropriately within your application.

import {useTacoTranslate, Translate} from 'tacotranslate/react';

function Page() {
  const {error} = useTacoTranslate();

  return (
    <div>
      {error ? <div>Error: {error.message}</div> : null}
      <Translate string="Hello, world!" />
    </div>
  );
}
Limbi acceptate

Un produs de la NattskiftetFabricat în Norvegia