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 tacotranslateThis 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!".
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.