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 w lan ak founisè TacoTranslate, epi itilize konpozan Translate la pou afiche fraz 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 mete pou itilize Panyòl (locale="es"), kidonk konpozan Translate ap afiche "¡Hola, mundo!".
Egzanp
Vizite katab egzanp GitHub nou an pou aprann plis sou kijan pou konfigire TacoTranslate espesyalman pou ka itilizasyon ou, tankou ak Next.js App Router, oswa lè w ap itilize Create React App.
Nou genyen tou yon CodeSandbox ki mete kanpe ke ou ka tcheke isit la.