Başlayaq
Quraşdırma
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.
Əsas istifadə
Aşağıdakı nümunə TacoTranslate klientini necə yaratmağı, tətbiqinizi TacoTranslate provayderi ilə necə sarmağı və tərcümə olunmuş mətnləri göstərmək üçün Translate komponentindən necə istifadə etməyi nümayiş etdirir.
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>
);
}Nümunə İspan dilindən istifadə edəcək şəkildə təyin edilib (locale="es"), buna görə Translate komponenti "¡Hola, mundo!" göstərəcək.
Nümunələr
Öz istifadə halınız üçün TacoTranslateı necə qurmağı daha ətraflı öyrənmək üçün GitHub nümunələr qovluğumuza daxil olun, məsələn Next.js App Router ilə və ya Create React App istifadə edərək.
Həmçinin bir CodeSandbox qurmuşuq, onu buradan yoxlaya bilərsiniz.