小编Viv*_*iya的帖子

在 javascript 中的 Google Transliterate API 中出现错误

我在我的项目中使用 Google Transliterate API 将英文文本翻译成古吉拉特语。它工作正常,但是我现在在 google-jsapi 中遇到了问题。

这是我的代码:

<script type="text/javascript" src="http://www.google.com/jsapi"></script>

<script>
google.load("elements", "1", {
    packages: "transliteration"
});

function onLoad() {

    var options = {
        sourceLanguage: 'en',
        destinationLanguage: ['gu'],
        shortcutKey: 'ctrl+g',
        transliterationEnabled: true
    };
    // Create an instance on TransliterationControl with the required
    // options.
    var control = new google.elements.transliteration.TransliterationControl(options);

    // Enable transliteration in the textfields with the given ids.

    var ids = [ "cus_name", "address"];
    control.makeTransliteratable(ids);

    // Show the transliteration control which can be used to toggle between
    // …
Run Code Online (Sandbox Code Playgroud)

javascript google-translation-api

9
推荐指数
1
解决办法
2524
查看次数

标签 统计

google-translation-api ×1

javascript ×1