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 키 생성

예제

특정 사용 사례에 맞게 TacoTranslate를 설정하는 방법을 자세히 알아보려면, Next.js App Router 또는 Create React App 사용과 같은 경우를 포함해 저희 GitHub 예제 폴더를 방문하세요.

또한 CodeSandbox도 설정해 두었으니 여기에서 확인해 보세요.

설정 및 구성

Nattskiftet의 제품노르웨이에서 제작