よくある質問
よくある質問すべての Gutenberg ブロックを翻訳できますか?

すべての Gutenberg ブロックを翻訳できますか?

Gato AI Translations for Polylang は、WordPress コアのすべてのブロックをそのまま翻訳し、カスタムブロックやサードパーティ製ブロックの統合もサポートしています。

翻訳対象の文字列を比較的わかりやすい形で公開しているブロックであれば、新しいブロックでも対応可能です。ただし、それが常に当てはまるわけではありません。

Yoast SEO のブロック(Yoast How-toYoast FAQ)はその好例です。これらのブロックはシンプルな文字列のみに対応しています。

シンプルな文字列を含む Yoast FAQ ブロック
シンプルな文字列を含む Yoast FAQ ブロック

HTMLタグを含む文字列(リンク、画像、strong や italic などの HTML スタイル、改行など)はサポートされていません。

HTMLタグを含む Yoast FAQ ブロック
HTMLタグを含む Yoast FAQ ブロック

これは、Yoast ブロックがデータを保存する方法に起因しており、文字列と入れ子プロパティを持つ JSON が混在しています。

HTMLタグを含む Yoast FAQ ブロックのコード
HTMLタグを含む Yoast FAQ ブロックのコード

その内容は次のようなものです。

{
    "question": [
        "L'émergence d'études plus récentes sur le collagène marin tendent à montrer qu'il possède des qualités biologiques très favorables",
        {
            "type": "sup",
            "props": {
                "children": [
                    {
                        "type": "a",
                        "props": {
                            "href": "#bibliographie",
                            "children": [
                                "5"
                            ]
                        }
                    }
                ]
            }
        },
        "•",
        {
            "type": "br",
            "props": {
                "children": [
                    1
                ]
            }
        },
        {
            "type": "br",
            "props": {
                "children": [
                    1
                ]
            }
        },
        "De plus, l'extraction du collagène marin permet d'exploiter et de valoriser les sous-produits de l'industrie de transformation du poisson voués à la perte. Par ailleurs, le collagène marin présente des avantages par rapport au collagène bovin : moins de risque de transmission de maladie et aucune considération religieuse",
        {
            "type": "sup",
            "props": {
                "children": [
                    {
                        "type": "a",
                        "props": {
                            "href": "#bibliographie",
                            "children": [
                                "6"
                            ]
                        }
                    }
                ]
            }
        },
        ". ",
        {
            "type": "br",
            "props": {
                "children": []
            }
        },
        {
            "type": "br",
            "props": {
                "children": []
            }
        },
        "Néanmoins, les équipes de recherche ne sont pas unanimes sur l'efficacité de l'un par rapport à l'autre. Ce d'autant que plusieurs facteurs peuvent affecter la manière dont le collagène est assimilé."
    ],
    "jsonQuestion": "<strong>Quel est le meilleur collagène : marin ou bovin ?</strong>"
}

プラグインは JSON 構造全体を AI サービスに送信することができません。AI がそれを正しく解釈する保証がないためです。また、JSON 構造内のプロパティが何を表すかわからないため(例:children の場合もあれば、そうでない場合もあります)、翻訳対象の文字列だけを抽出して送信することも困難です。

さらに、Yoast ブロックは同じ情報を3回(プロパティ answerjsonAnswer、そしてレンダリングされた HTML コンテンツ内のテキスト)、それぞれ異なる形式で保存しており、翻訳結果が一致しないと Gutenberg エディターがそのブロックにエラーを表示します。これを実現することは現実的ではありません。

そのため、プラグインはこれらのブロックに対してシンプルな文字列のみをサポートしています。