使用Google翻译API翻译完整的网站

时间:2015-09-16 02:01:39

标签: php google-api google-translate

是否可以使用google translate api翻译整个网站?

例如: 您可以在此处粘贴网址https://translate.google.com/ 和谷歌翻译整个网站。

我想用php做同样的事情。

我给谷歌这个

<!DOCTYPE html>
<html>
    <head>
        <title>Haus</title>
        <meta charset="UTF-8">
    </head>
    <body>
        <div id="redCar">Ein rotes Auto.</div>
    </body>
</html>

并将谷歌翻译成(例如德语)
响应:

 protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);        
        setContentView(R.layout.activity_main);     

        initView();   
    }

    private void initView() {
        // show progress dialog
        dialog = ProgressDialog.show(this, "", "Loading...");

        String url = "xxxxxxxx";
        // json class doing background data processing  
        FetchDataTask task = new FetchDataTask(this);
        task.execute(url);
    }

    @Override
    public void onFetchComplete(List<Application> data) {
        // dismiss the progress dialog
        if(dialog != null)  dialog.dismiss();
        // create new adapter
     ApplicationAdapter adapter = new ApplicationAdapter(this, data);
        // set the adapter to list
        lv.setAdapter(adapter);        

         }

可能?我找到了翻译单词和句子的方法。

0 个答案:

没有答案
相关问题