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 provider එකෙන් වටකරන ආකාරය සහ පරිවර්තනය කළ පෙළ පෙන්වීමට Translate component එක භාවිතා කරන ආකාරයයි.

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 විසින් නිෂ්පාදිත නිෂ්පාදනයක්නෝර්වේ නිෂ්පාදිත