TacoTranslate
/
DokimantasyonPri
 
  1. Entwodiksyon
  2. Kòmanse
  3. Mete kanpe ak konfigirasyon
  4. Sèvi ak TacoTranslate
  5. Rann sou bò sèvè
  6. Itilizasyon avanse
  7. Pi bon pratik
  8. Jesyon erè ak debogaj
  9. Lang sipòte

Kòmanse

Enstalasyon

To install TacoTranslate in your application, open your terminal and navigate to the root directory of your project. Then, run the following command to install with npm:

npm install tacotranslate

This assumes you already have an application set up. See examples for more information.

Itilizasyon debaz

Egzanp ki anba a montre kijan pou kreye yon kliyan TacoTranslate, vlope aplikasyon ou a ak founisè TacoTranslate, epi itilize konpozan Translate pou afiche tèks ki tradui yo.

import createTacoTranslateClient from 'tacotranslate';
import {TacoTranslate, Translate} from 'tacotranslate/react';

const tacoTranslateClient = createTacoTranslateClient({apiKey: 'YOUR_API_KEY'});

function Page() {
	return <Translate string="Hello, world!" />;
}

export default function App() {
  return (
    <TacoTranslate client={tacoTranslateClient} locale="es">
      <Page />
    </TacoTranslate>
  );
}

Egzanp nan fèt pou itilize Panyòl (locale="es"), kidonk konpozan Translate ap montre "¡Hola, mundo!".

Kreye yon kle API

Egzanp

Ale gade nan katab egzanp GitHub nou an pou aprann plis sou kijan pou konfigire TacoTranslate espesyalman pou ka ou a, tankou ak Next.js App Router, oswa lè w ap itilize Create React App.

Nou genyen tou yon CodeSandbox ke nou mete kanpe pou ou ka tcheke isit la.

Mete kanpe ak konfigirasyon

Yon pwodwi soti nan NattskiftetFèt nan Nòvèj