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תוצרת נורווגיה