<bdo id='EfKzP'></bdo><ul id='EfKzP'></ul>
      <i id='EfKzP'><tr id='EfKzP'><dt id='EfKzP'><q id='EfKzP'><span id='EfKzP'><b id='EfKzP'><form id='EfKzP'><ins id='EfKzP'></ins><ul id='EfKzP'></ul><sub id='EfKzP'></sub></form><legend id='EfKzP'></legend><bdo id='EfKzP'><pre id='EfKzP'><center id='EfKzP'></center></pre></bdo></b><th id='EfKzP'></th></span></q></dt></tr></i><div id='EfKzP'><tfoot id='EfKzP'></tfoot><dl id='EfKzP'><fieldset id='EfKzP'></fieldset></dl></div>
        <legend id='EfKzP'><style id='EfKzP'><dir id='EfKzP'><q id='EfKzP'></q></dir></style></legend>
      1. <small id='EfKzP'></small><noframes id='EfKzP'>

        <tfoot id='EfKzP'></tfoot>

        从 Google Translate API 获取中文罗马拼音

        时间:2023-10-13
      2. <tfoot id='lblGt'></tfoot>

              <bdo id='lblGt'></bdo><ul id='lblGt'></ul>
              <legend id='lblGt'><style id='lblGt'><dir id='lblGt'><q id='lblGt'></q></dir></style></legend>
              <i id='lblGt'><tr id='lblGt'><dt id='lblGt'><q id='lblGt'><span id='lblGt'><b id='lblGt'><form id='lblGt'><ins id='lblGt'></ins><ul id='lblGt'></ul><sub id='lblGt'></sub></form><legend id='lblGt'></legend><bdo id='lblGt'><pre id='lblGt'><center id='lblGt'></center></pre></bdo></b><th id='lblGt'></th></span></q></dt></tr></i><div id='lblGt'><tfoot id='lblGt'></tfoot><dl id='lblGt'><fieldset id='lblGt'></fieldset></dl></div>

                <tbody id='lblGt'></tbody>

                  <small id='lblGt'></small><noframes id='lblGt'>

                  本文介绍了从 Google Translate API 获取中文罗马拼音的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  Google 语言翻译 A​​PI 可以干净利落地翻译成中文:

                  The Google language translate API works cleanly to translate into Chinese:

                  <script type="text/javascript" src="http://www.google.com/jsapi"></script>
                  <script>
                    google.load('language','1');
                    function googletrans(text) {
                      google.language.translate(text,'en','zh',function(result) {
                        alert(result.translation);
                      });
                    }
                  </script>
                  <input onchange="googletrans(this.value);">
                  Example input: "Hello"
                  Result: "你好"
                  

                  我的问题是我无法获得罗马拼音(使用英文字母的发音).这是一个已知问题.

                  My problem is I can't get the Romanization (pronunciation using English letters). This is a known issue.

                  现在数据就在 translate.google.com 上(示例输入:Hello" 结果:Nǐ hǎo"),我什至可以通过将浏览器指向:

                  Now the data is right there on translate.google.com (Example input: "Hello" Result: "Nǐ hǎo") and I can even see it by pointing my browser to:

                  http://translate.google.com/translate_a/t?client=t&text=hello&hl=en&sl=en&tl=zh-CN&otf=2&pc=0
                  Result:
                  {"sentences":[{"trans":"你好","orig":"hello","translit":"Nǐ hǎo"}],
                   "dict":[{"pos":"interjection","terms":["喂"]}],"src":"en"}
                  

                  但不知何故,当我尝试使用 ajax 获取此 URL 时,它失败了(XMLHttpRequest 异常 101).有没有办法用 ajax 检索这个罗马化数据?

                  But somehow when I try to get this URL with ajax it fails (XMLHttpRequest Exception 101). Is there any way to retrieve this Romanization data with ajax?

                  推荐答案

                  今天看来不可能,但 Google Translate API 上存在未解决的问题来解决这个问题.如果我们能够围绕这个问题召集足够多的人,也许 Google 会提高其优先级:

                  It doesn't appear possible today, but there are open issues on the Google Translate API to address this. If we can rally enough people around the issue, perhaps Google will raise its priority:

                  1) http://code.google.com/p/google-ajax-apis/issues/detail?id=478&q=label%3AAPIType-Language&sort=-stars&colspec=ID%20Type%20Stars%20Status%20Modified%20Summary%20APIType%20Opened

                  2) http://code.google.com/p/google-ajax-apis/issues/detail?id=381&q=label%3AAPIType-Language&sort=-stars&colspec=ID%20Type%20Stars%20Status%20Modified%20Summary%20APIType%20Opened

                  这篇关于从 Google Translate API 获取中文罗马拼音的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:浏览器的 AJAX (XmlHttpRequest) 超时长度 下一篇:使用 XMLHttpRequest 将多个文件上传到 Express.js 3.5

                  相关文章

                  最新文章

                      <bdo id='u0XO3'></bdo><ul id='u0XO3'></ul>
                    <i id='u0XO3'><tr id='u0XO3'><dt id='u0XO3'><q id='u0XO3'><span id='u0XO3'><b id='u0XO3'><form id='u0XO3'><ins id='u0XO3'></ins><ul id='u0XO3'></ul><sub id='u0XO3'></sub></form><legend id='u0XO3'></legend><bdo id='u0XO3'><pre id='u0XO3'><center id='u0XO3'></center></pre></bdo></b><th id='u0XO3'></th></span></q></dt></tr></i><div id='u0XO3'><tfoot id='u0XO3'></tfoot><dl id='u0XO3'><fieldset id='u0XO3'></fieldset></dl></div>

                    1. <legend id='u0XO3'><style id='u0XO3'><dir id='u0XO3'><q id='u0XO3'></q></dir></style></legend>

                    2. <tfoot id='u0XO3'></tfoot>

                      <small id='u0XO3'></small><noframes id='u0XO3'>