ಪ್ರಾರಂಭಿಸಲು
ಸ್ಥಾಪನೆ
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.
ಮೂಲಭೂತ ಬಳಕೆ
ಕೆಳಗಿನ ಉದಾಹರಣೆ 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!" ಅನ್ನು ಪ್ರದರ್ಶಿಸುತ್ತದೆ.
ಉದಾಹರಣೆಗಳು
ನಮ್ಮ GitHub ಉದಾಹರಣೆ ಫೋಲ್ಡರ್ಗೆ ಭೇಟಿ ನೀಡಿ ಮತ್ತು ಉದಾಹರಣೆಗೆ Next.js App Router ಅಥವಾ Create React App ಬಳಸುವಂತೆ, ನಿಮ್ಮ ಬಳಕೆಯ ಸಂದರ್ಭಕ್ಕೆ ಸೂಕ್ತವಾಗಿ TacoTranslate ಅನ್ನು ಹೇಗೆ ಸಂರಚಿಸಬೇಕೆಂದು ಇನ್ನಷ್ಟು ತಿಳಿಯಿರಿ.
ನಾವು ಇನ್ನೊಂದು CodeSandbox ಅನ್ನು ಕೂಡ ಸಿದ್ಧಪಡಿಸಿದ್ದೇವೆ, ನೀವು ಅದನ್ನು ಇಲ್ಲಿ ಪರಿಶೀಲಿಸಬಹುದು.