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 サンプルフォルダ にアクセスして、例えば Next.js App Router を使う場合や Create React App を利用する場合など、特定のユースケース向けに TacoTranslate を設定する方法について詳しく学んでください。

また、CodeSandbox を用意しており、こちらでご覧いただけます

セットアップと構成

Nattskiftetの製品ノルウェー製