0

JSの翻訳ライブラリであるGlottologistを利用して以下の様なtest.html内に記載した所定の箇所の英文をp要素を使用して日本語に自動翻訳しようとしたのですが、以下のHTMLファイルで表示させようとすると翻訳されず、英文(This is a test.)がそのまま表示されます。どこに問題があるかお教え頂けませんでしょうか?

test.html

<!doctype html>
<html>

<body class="text-center">

<p id="p" glot-model="text">This is a test.</p>   

<script src="https://unpkg.com/glottologist"></script>
<script>
const p = document.getElementById('p'); 
const glot = new Glottologist();
glot.t( p.textContent, 'ja' ).then( result => {
p.textContent = result;
})
</script>
    
</body>
</html>

0

この質問に回答するには、ログインする必要があります。

のタグが付いた他の質問を参照する。