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 examples フォルダ にアクセスしてください。

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

セットアップと設定

Nattskiftetの製品ノルウェー製