TacoTranslate
/
תיעודמחירים
 
  1. מבוא
  2. התחלה מהירה
  3. הגדרה ותצורה
  4. שימוש ב-TacoTranslate
  5. רינדור בצד השרת
  6. שימוש מתקדם
  7. שיטות עבודה מומלצות
  8. טיפול בשגיאות וניפוי תקלות
  9. שפות נתמכות

התחלה מהירה

התקנה

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.

שימוש בסיסי

הדוגמה שלמטה מדגימה כיצד ליצור לקוח של TacoTranslate, לעטוף את היישום שלך עם הספק של TacoTranslate, ולהשתמש ברכיב Translate כדי להציג מחרוזות מתורגמות.

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>
  );
}

הדוגמה מוגדרת להשתמש בספרדית (locale="es"), לכן הרכיב Translate יציג "¡Hola, mundo!".

צור מפתח API

דוגמאות

עבור אל תיקיית הדוגמאות שלנו ב-GitHub כדי ללמוד עוד על אופן ההגדרה של TacoTranslate במיוחד עבור מקרה השימוש שלך, למשל עם Next.js App Router, או בשימוש ב־Create React App.

בנוסף, יש לנו CodeSandbox שהקמנו שתוכלו לעיין בו כאן.

הגדרה ותצורה

מוצר מבית Nattskiftetעשוי בנורווגיה