本文へスキップ

WooCommerce 向け glot

EC · プラグイン

glot は WooCommerce にプラグインとしてインストールします。設定方法は下の手順のとおりです。

プラットフォーム側の手順は、WooCommerce の画面のメニュー名に合わせて英語で記載しています。

glot プラグインをインストールする

  1. Download glot.zip (built from integrations/wordpress-plugin in the glot repository; it isn't on WordPress.org yet). It needs WordPress 6.1+ and PHP 7.4+.
  2. In WordPress, go to Plugins → Add New → Upload Plugin, upload glot.zip and activate it.
  3. Open Settings → glot and enter your project slug, your public key (pk_…, never a secret glot_… key), the source language and your languages, then save. The plugin adds glot.js to every front-end page.
  4. Optional: place the language switcher with the [glot_switcher] shortcode, the glot language switcher widget or block, or the Elementor widget; otherwise it sits in the corner you picked.
  5. WooCommerce: cart, checkout and account forms are never read; customer details on order and address pages are marked so they are never translated or reported.
  6. Optional: for translated URLs, set up glot Edge (subdomain or subdirectory) and choose it as the SEO mode, so the plugin adds hreflang links to the Edge pages.
  7. Optional: click Connect to glot with a glot API token to link the WordPress connector, so translations are also written into Polylang Pro or WPML posts.
コネクタの詳しいドキュメント

別の方法:ユニバーサルタグ

WooCommerce 連携で対応していない部分をブラウザで翻訳するには、ユニバーサルタグを追加します。

  1. glot でプロジェクトを作成し、言語を追加します。
  2. glot Edge → サイト用タグを開き、サイトのアドレスを入力します。glot がサイトを翻訳してプレビューを表示します。タグを貼り付けたら、同じ画面でインストールを確認し、タグをオンにします。
  3. そのタブからタグをコピーします。プロジェクトと公開キー(data-key)はすでに入っています。下のタグはその形式の例です。
glot タグ
<script src="https://app.glotlang.com/widget/glot.js" data-project="your-project" data-key="pk_…" async></script>
  1. Do not edit the parent theme's files: theme updates overwrite them.
  2. Either install a plugin that lets you add custom code (for example Code Snippets), or create a child theme.
  3. In the child theme's functions.php (or a new snippet), hook a function on wp_head that echoes the glot tag.
  4. Save or activate the snippet and clear any caching plugin.
  5. Open your store in a private window and check that the language menu appears.
サイト用タグのガイド

必要なプラン

WooCommerce is self-hosted and free; any WordPress install where you can add plugins or edit a child theme can add the tag. On managed WordPress.com, plugins require a plan that allows them.

glot の各プランの内容は料金ページをご覧ください。glot Edge(翻訳済み URL)は Growth プランに含まれ、Pro では限定トライアルを利用できます。

検索エンジン向けの翻訳済み URL

JavaScript を実行せずに検索エンジンがインデックスできる翻訳ページにするには、2 つの DNS レコードで glot Edge をドメインのサブドメイン(es.example.com)に置きます。

DNS レコード(TXT トークンは glot Edge → セットアップに表示されます)
es.example.com.        CNAME  edge.glotlang.com.
_glot.es.example.com.  TXT    "<token shown in the dashboard>"

Add the CNAME and TXT wherever your domain's DNS is hosted (registrar, hosting provider or DNS service). You control your own domain on a self-hosted store.

glot Edge の仕組み

よくある質問

glot は WooCommerce のパートナーですか?
いいえ。glot は独立しており、WooCommerce との提携や WooCommerce による推奨はありません。このガイドは WooCommerce の標準機能だけを使っています。
glot は WooCommerce のコンテンツを変更しますか?
元のコンテンツはそのままです。プラグインはブラウザでページを翻訳し、接続すると、公開前に確認できる言語フィールドに翻訳を書き込みます。
翻訳は検索エンジンにインデックスされますか?
タグだけではほとんどされません。ブラウザで翻訳するため、検索エンジンが主にインデックスするのは元の言語です。言語ごとの URL を持つ翻訳ページには、glot Edge か、言語ごとに URL を公開するプラットフォームが必要です。
Should I paste the tag in the theme editor's header.php?
Not in the parent theme: an update erases it. WooCommerce's docs recommend a child theme's functions.php or a code-snippets plugin.
Does it work on the block checkout and cart?
The tag runs on every page that prints wp_head, including cart and checkout pages of standard themes.

WooCommerce の公式ドキュメント

WooCommerce のサイトを翻訳する

プロジェクトを作成して言語を選び、上の手順に従ってください。

WooCommerce は各所有者の商標です。glot は WooCommerce と提携していません。