Merhaba arkadaslar internette dolasirken deyisik biseye rastladim.
http://www.gastromax24.de bu adresteki sayfa sol yukardaki bayraklara dillere yani jQuery-Translater ile google ceviricinden ceviri yaptiriyor isin güzelligi yukarda googel görükmeden sanki sayfa gercekten o dille yapilmis gibi sayfa icerine baktim ve arastirma yaptim ve arastirma sonucunda scripti buldum
http://jsbin.com/ozenu/edit bu sayfada anlatilmis ama konuya hakim olmadigimdan java dosyalarini nasil neriye koyucami ve nasil sayfaya eklicemi cözemedim yardimci olucak birine cok tesekkür edrim..
ilgilenen olursa gercekten sevinirim simdiden tesekkürler...
Google ceviricisi jQuery ile nasil?
7
●1.227
- 02-04-2010, 12:24:03Zaten orada anlatmış ben sana oradaki kodlarla veriyim bunu bi html sayfa yapıştır çalışır
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <script class="jsbin" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> <script src="http://jquery-translate.googlecode.com/files/jquery.translate-1.3.7.min.js"></script> <script src="http://stilbuero.de/jquery/cookie/jquery.cookie.pack.js"></script> <title>Sandbox</title> <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> <style type="text/css" media="screen"> body { background-color: #000; font: 16px Helvetica, Arial; color: #fff; } </style> </head> <body> <p>Hello from JS Bin</p> <p id="hello"></p> <script type="text/javascript"> document.getElementById("hello").innerHTML = "Hello World - this was inserted using JavaScript"; jQuery(function($){ //when DOM is ready $('body').css('height','800px'); $.translate(function(){ //when the Google Language API is loaded function translateTo( destLang ){ //this can be declared in the global scope too if you need it somewhere else $('body').translate( 'english', destLang, { //translate from english to the selected language not: '.jq-translate-ui', //by default the generated element has this className fromOriginal:true //always translate from english (even after the page has been translated) //unnecessary in v1.4, the default value is true }); } //you can generate other controls as well, not just a dropdown: //there are new features in v1.4: http://code.google.com/p/jquery-translate/wiki/Extensions $.translate.ui('ul', 'li', 'span') .appendTo('body') //insert the element to the page .css({'color':'blue', 'background-color':'white'}) .find('span') .css('cursor','pointer') .click(function(){ //when selecting another language //in v1.4 $(this).val() or $(this).attr("value") // is always the exact language code! translateTo( $(this).text() ); $.cookie('destLang', $(this).text() ); // set a cookie to remember the selected language // see: http://plugins.jquery.com/project/Cookie return false; //prevent default browser action }) var destLang = $.cookie('destLang'); //get previously translated language if( destLang ) //if it was set then translateTo( destLang ); }); //end of Google Language API loaded }) //end of DOM ready </script> </body> </html> - 02-04-2010, 12:49:32Tesekkür ederim cevabiniz icin. ama Bu sekilde kopyaladimi sayfa calisiyor fakat kendi sayfama nasil yerlestircem onu bulamadim. www.gastro-quelle.com bu shop sayfasini calisiyorum ve sag alt boxa kodlari yapistirdim calismiyor. sorum örnek verdigim sitedeki gibi orda calistirmislar ben nasil calistirabilirim onu soruyorum.. yardimci olabilirseniz cok tesekkür ederim...
- 02-04-2010, 13:41:10Anladığım kadarı ile sen kendi sayfanda çalıştıramıyorsun (yanlış anlamış olabilirim kusura bakma...)
İlk once head taglarının arasına bu kodları koy
<script class="jsbin" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> <script src="http://jquery-translate.googlecode.com/files/jquery.translate-1.3.7.min.js"></script> <script src="http://stilbuero.de/jquery/cookie/jquery.cookie.pack.js"></script>
Body tagının arasındaki butun yazıları çevirmesi için yaptığın siteyi <p> tagının arasına al
<body> <p>Buraya siten gelcek tabloları filan</p> </body>
Son olarak sitenin en altına bodyden once bu kodu koy
<script type="text/javascript"> jQuery(function($){ //when DOM is ready $('body').css('height','800px'); $.translate(function(){ //when the Google Language API is loaded function translateTo( destLang ){ //this can be declared in the global scope too if you need it somewhere else $('body').translate( 'english', destLang, { //translate from english to the selected language not: '.jq-translate-ui', //by default the generated element has this className fromOriginal:true //always translate from english (even after the page has been translated) //unnecessary in v1.4, the default value is true }); } //you can generate other controls as well, not just a dropdown: //there are new features in v1.4: http://code.google.com/p/jquery-translate/wiki/Extensions $.translate.ui('ul', 'li', 'span') .appendTo('body') //insert the element to the page .css({'color':'blue', 'background-color':'white'}) .find('span') .css('cursor','pointer') .click(function(){ //when selecting another language //in v1.4 $(this).val() or $(this).attr("value") // is always the exact language code! translateTo( $(this).text() ); $.cookie('destLang', $(this).text() ); // set a cookie to remember the selected language // see: http://plugins.jquery.com/project/Cookie return false; //prevent default browser action }) var destLang = $.cookie('destLang'); //get previously translated language if( destLang ) //if it was set then translateTo( destLang ); }); //end of Google Language API loaded }) //end of DOM ready </script>
Son hepsi toparlanmış hali
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>title</title> <script class="jsbin" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> <script src="http://jquery-translate.googlecode.com/files/jquery.translate-1.3.7.min.js"></script> <script src="http://stilbuero.de/jquery/cookie/jquery.cookie.pack.js"></script> </head> <body> <p>Buraya siten gelcek tabloları filan</p> <script type="text/javascript"> jQuery(function($){ //when DOM is ready $('body').css('height','800px'); $.translate(function(){ //when the Google Language API is loaded function translateTo( destLang ){ //this can be declared in the global scope too if you need it somewhere else $('body').translate( 'turkish', destLang, { //translate from english to the selected language not: '.jq-translate-ui', //by default the generated element has this className fromOriginal:true //always translate from english (even after the page has been translated) //unnecessary in v1.4, the default value is true }); } //you can generate other controls as well, not just a dropdown: //there are new features in v1.4: http://code.google.com/p/jquery-translate/wiki/Extensions $.translate.ui('ul', 'li', 'span') .appendTo('body') //insert the element to the page .css({'color':'blue', 'background-color':'white'}) .find('span') .css('cursor','pointer') .click(function(){ //when selecting another language //in v1.4 $(this).val() or $(this).attr("value") // is always the exact language code! translateTo( $(this).text() ); $.cookie('destLang', $(this).text() ); // set a cookie to remember the selected language // see: http://plugins.jquery.com/project/Cookie return false; //prevent default browser action }) var destLang = $.cookie('destLang'); //get previously translated language if( destLang ) //if it was set then translateTo( destLang ); }); //end of Google Language API loaded }) //end of DOM ready </script> </body> </html> - 02-04-2010, 13:53:46Tekrar cok tesekkürler hizli cevabiniz iicn.. Benim sorunum Shop sitesi xtc-commerce üzerine yapilmis bir SHOP kendi templatesini giydirmis ve nodüller eklemis.
ama sayfadaki index.php de bunlar var..
-----------------
include ('includes/application_top.php');
// create smarty elements
$smarty = new Smarty;
// include boxes
require (DIR_FS_CATALOG.'templates/'.CURRENT_TEMPLATE.'/source/boxes.php');
// the following cPath references come from application_top.php
$category_depth = 'top';
if (isset ($cPath) && xtc_not_null($cPath)) {
// BOF GM_MOD
if(GROUP_CHECK == 'false')
{
$categories_products_query = "SELECT COUNT(*) AS total
FROM
".TABLE_PRODUCTS_TO_CATEGORIES." ptc,
" . TABLE_PRODUCTS . " p
WHERE
ptc.categories_id = '".$current_category_id."'
AND ptc.products_id = p.products_id
AND p.products_status = '1'";
}
else
{
$c_gm_customers_status_id = (int)$_SESSION['customers_status']['customers_status_id'];
$categories_products_query = "SELECT COUNT(*) AS total
FROM
".TABLE_PRODUCTS_TO_CATEGORIES." ptc,
" . TABLE_PRODUCTS . " p
WHERE
ptc.categories_id = '".$current_category_id."'
AND ptc.products_id = p.products_id
AND p.products_status = '1'
AND p.group_permission_" . $c_gm_customers_status_id . " = '1'";
}
// EOF GM_MOD
$categories_products_query = xtDBquery($categories_products_query);
$cateqories_products = xtc_db_fetch_array($categories_products_query, true);
if ($cateqories_products['total'] > 0) {
$category_depth = 'products'; // display products
} else {
$category_parent_query = "select count(*) as total from ".TABLE_CATEGORIES." where parent_id = '".$current_category_id."'";
$category_parent_query = xtDBquery($category_parent_query);
$category_parent = xtc_db_fetch_array($category_parent_query, true);
if ($category_parent['total'] > 0) {
$category_depth = 'nested'; // navigate through the categories
} else {
$category_depth = 'products'; // category has no products, but display the 'no products' message
}
}
}
require (DIR_WS_INCLUDES.'header.php');
include (DIR_WS_MODULES.'default.php');
$smarty->assign('language', $_SESSION['language']);
$smarty->caching = 0;
if (!defined(RM))
$smarty->load_filter('output', 'note');
$smarty->display(CURRENT_TEMPLATE.'/index.html');
include ('includes/application_bottom.php');
?>
------------------
SORU: burdami kullanicam o kodlari yoksa baska yeremi? eger vaktiniz olurda bakabilirseniz sevinirim.. Tesekkürler... - 02-04-2010, 15:34:58xtc-commerce scriptini bilmiyorum nasıl olduğunu ama head taglarının olduğunu sayfa vardır ya templatenin eklendiği yerde vardır yada normal sayfalarda include etmiştir
include ('includes/application_top.php'); require (DIR_FS_CATALOG.'templates/'.CURRENT_TEMPLATE.'/source/boxes.php'); require (DIR_WS_INCLUDES.'header.php'); include (DIR_WS_MODULES.'default.php');gördugun gibi buralarda bazı sayfaları include veya require etmiş bunların içindede olabilir veya onların içindede include etmiş olabilir??? - 02-04-2010, 15:48:29yani benim bulam gereken head taglarinin oldu sayfami? tam anliyamadim... birde ana sayfada listelenirken bircok box listeleniyor
ben boxsun birine koydugumda kodlari o head olan sayfaya nasil yönlendircem?
http://www.gastromax24.de sayfasida ayni mantikta calisiyor onlar bir sekilde yüklemis... halen beceremedim