阻止谷歌翻译HTML属性

时间:2015-09-19 10:45:14

标签: html5 google-translate

我正在使用谷歌翻译API并面临以下问题,API会翻译内容以及HTML属性。

E.g

btMap.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { String search = inputSearch.getText().toString(); if(search.equals("")) { double latitude = 0; double longitude = 0; String mark; // SQLite database handler db = new TreeData(getApplicationContext()); Cursor locationCursor = db.getLocations(); locationCursor.moveToFirst(); do { latitude = locationCursor.getDouble(locationCursor .getColumnIndex(SQLiteHandler.KEY_TLATITUDE)); longitude = locationCursor.getDouble(locationCursor .getColumnIndex(SQLiteHandler.KEY_TLONGITUDE)); mark = locationCursor.getString(locationCursor .getColumnIndex(SQLiteHandler.KEY_TreeID)); LatLng location = new LatLng(latitude, longitude); mMap.addMarker(new MarkerOptions().position(location).title(mark)); } while (locationCursor.moveToNext()); } if(search.length()>0){ //float zoom = 0; mMap.clear(); // SQLite database handler db = new TreeData(getApplicationContext()); Cursor c = db.getSelectedLocations(search); c.moveToFirst(); do { double latitude1 = c.getDouble(c .getColumnIndex(SQLiteHandler.KEY_TLATITUDE)); double longitude1 = c.getDouble(c .getColumnIndex(SQLiteHandler.KEY_TLONGITUDE)); String marker = c.getString(c .getColumnIndex(SQLiteHandler.KEY_TreeID)); LatLng location = new LatLng(latitude1, longitude1); mMap.addMarker(new MarkerOptions().position(location).title(marker)); // Moving CameraPosition to last clicked position mMap.moveCamera(CameraUpdateFactory.newLatLng(location)); // Setting the zoom level in the map on last position is clicked mMap.animateCamera(CameraUpdateFactory.newLatLng(location)); } while (c.moveToNext()); Toast.makeText(getApplicationContext(), "All is Well", Toast.LENGTH_LONG).show(); } else{ Toast.makeText(getApplicationContext(), "Invalid", Toast.LENGTH_LONG).show(); } } });}

翻译成荷兰语

<span class="step-number two">2</span>

我不希望我的类属性被翻译为它,因为它弄乱了我页面的所有样式。有没有办法这样做。?

使用&#39; google-translate&#39; (针对Node.js的Google Translate API)

E.g

<span class = "stap-nummer twee"> 2 </ span>

代替&#39;你好&#39; ,我提供我的HTML

0 个答案:

没有答案