Pratik olarak Çok dilli site yapımı

Merhaba arkadaşlar. Bugün sizlere bir sitenin nasıl pratik olarak çok dil desteklekler hale getirilebileceğini anlatacağım.

Öncelikle Gtranslate kütüphanemizi ve stil dosyamızı çekiyoruz aşağıdaki alanda olduğu gibi

<head> </head>

alanına yapıştırıyoruz

 

 <head> <center><!-- GTranslate: http://gtranslate.net/ --> <style type="text/css"> <!-- a.gflag {vertical-align:middle;font-size:24px;padding:1px 0;background-repeat:no-repeat;background-image:url('http://joomla-gtranslate.googlecode.com/svn/trunk/mod_gtranslate/tmpl/lang/24.png');} a.gflag img {border:0;} a.gflag:hover {background-image:url('http://joomla-gtranslate.googlecode.com/svn/trunk/mod_gtranslate/tmpl/lang/24a.png');} #goog-gt-tt {display:none !important;} .goog-te-banner-frame {display:none !important;} .goog-te-menu-value:hover {text-decoration:none !important;} body {top:0 !important;} #google_translate_element2 {display:none!important;} --> </style> <div id="google_translate_element2"> <div class="skiptranslate goog-te-gadget" dir="ltr"> <div id=":0.targetLanguage"> <script type="text/javascript"> function googleTranslateElementInit2() {new google.translate.TranslateElement({pageLanguage: 'tr',autoDisplay: false}, 'google_translate_element2');} </script><script type="text/javascript" src="http://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit2"></script> <script type="text/javascript"> /* <![CDATA[ */ eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))}; if(!''.replace(/^/,String)){while(c--)r[e(c)]=k||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'}; c=1};while(c--)if(k)p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k);return p} ('6 7(a,b){n{4(2.9){3 c=2.9("o");c.p(b,f,f);a.q(c)}g{3 c=2.r();a.s(\'t\'+b,c)}}u(e){}}6 h(a){4(a.8)a=a.8;4(a==\'\')v;3 b=a.w(\'|\')[1];3 c;3 d=2.x(\'y\');z(3 i=0;i<d.5;i++)4(d[i].A==\'B-C-D\')c=d[i];4(2.j(\'k\')==E||2.j(\'k\').l.5==0||c.5==0||c.l.5==0){F(6(){h(a)},G)}g{c.8=b;7(c,\'m\');7(c,\'m\')}}',43,43,'||document|var|if|length|function|GTranslateFireEvent|value|createEvent||||||true|else|doGTranslate||getElementById|google_translate_element2|innerHTML|change|try|HTMLEvents|initEvent|dispatchEvent|createEventObject|fireEvent|on|catch|return|split|getElementsByTagName|select|for|className|goog|te|combo|null|setTimeout|500'.split('|'),0,{})) /* ]]> */ </script> <script type="text/javascript" src="http://joomla-gtranslate.googlecode.com/svn/trunk/gt_update_notes0.js"></script></center> </head> 

sonrasında dil dosyalarını koymak istediğimiz alanı seçip aşağıdaki kodları ekliyoruz. Burda mantık şu

 onclick="doGTranslate('tr|tr');return false;" 

tr|tr yazan alanı tr|en yazdığımızda ingilizce çevirecek tr|ar yazdığımızda arapça çevirecektir. yani burda ülke dillerinin evrensel kısa kodları kullanılmaktadır.

 <a href="#" onclick="doGTranslate('tr|tr');return false;" class="gflag nturl" style="background-position:-100px -500px;"> <img src="http://joomla-gtranslate.googlecode.com/svn/trunk/mod_gtranslate/tmpl/lang/blank.png" height="24" width="24"></a> <a href="#" onclick="doGTranslate('tr|az');return false;" class="gflag nturl" style="background-position:-500px -600px;"> <img src="http://joomla-gtranslate.googlecode.com/svn/trunk/mod_gtranslate/tmpl/lang/blank.png" height="24" width="24"></a> <a href="#" onclick="doGTranslate('tr|bg');return false;" class="gflag nturl" style="background-position:-200px -0px;"> <img src="http://joomla-gtranslate.googlecode.com/svn/trunk/mod_gtranslate/tmpl/lang/blank.png" height="24" width="24"></a> <a href="#" onclick="doGTranslate('tr|nl');return false;" class="gflag nturl" style="background-position:-0px -100px;"> <img src="http://joomla-gtranslate.googlecode.com/svn/trunk/mod_gtranslate/tmpl/lang/blank.png" height="24" width="24"></a> <a href="#" onclick="doGTranslate('tr|en');return false;" class="gflag nturl" style="background-position:-0px -0px;"> <img src="http://joomla-gtranslate.googlecode.com/svn/trunk/mod_gtranslate/tmpl/lang/blank.png" height="24" width="24"></a> <a href="#" onclick="doGTranslate('tr|fr');return false;" class="gflag nturl" style="background-position:-200px -100px;"> <img src="http://joomla-gtranslate.googlecode.com/svn/trunk/mod_gtranslate/tmpl/lang/blank.png" height="24" width="24"></a> <a href="#" onclick="doGTranslate('tr|de');return false;" class="gflag nturl" style="background-position:-300px -100px;"> <img src="http://joomla-gtranslate.googlecode.com/svn/trunk/mod_gtranslate/tmpl/lang/blank.png" height="24" width="24"></a> <a href="#" onclick="doGTranslate('tr|el');return false;" class="gflag nturl" style="background-position:-400px -100px;"> <img src="http://joomla-gtranslate.googlecode.com/svn/trunk/mod_gtranslate/tmpl/lang/blank.png" height="24" width="24"></a> <a href="#" onclick="doGTranslate('tr|it');return false;" class="gflag nturl" style="background-position:-600px -100px;"> <img src="http://joomla-gtranslate.googlecode.com/svn/trunk/mod_gtranslate/tmpl/lang/blank.png" height="24" width="24"></a> <a href="#" onclick="doGTranslate('tr|no');return false;" class="gflag nturl" style="background-position:-100px -200px;"> <img src="http://joomla-gtranslate.googlecode.com/svn/trunk/mod_gtranslate/tmpl/lang/blank.png" height="24" width="24"></a> <a href="#" onclick="doGTranslate('tr|pt');return false;" class="gflag nturl" style="background-position:-300px -200px;"> <img src="http://joomla-gtranslate.googlecode.com/svn/trunk/mod_gtranslate/tmpl/lang/blank.png" height="24" width="24"></a> <a href="#" onclick="doGTranslate('tr|ro');return false;" class="gflag nturl" style="background-position:-400px -200px;"> <img src="http://joomla-gtranslate.googlecode.com/svn/trunk/mod_gtranslate/tmpl/lang/blank.png" height="24" width="24"></a> <a href="#" onclick="doGTranslate('tr|ru');return false;" class="gflag nturl" style="background-position:-500px -200px;"> <img src="http://joomla-gtranslate.googlecode.com/svn/trunk/mod_gtranslate/tmpl/lang/blank.png" height="24" width="24"></a> <a href="#" onclick="doGTranslate('tr|sr');return false;" class="gflag nturl" style="background-position:-600px -300px;"> <img src="http://joomla-gtranslate.googlecode.com/svn/trunk/mod_gtranslate/tmpl/lang/blank.png" height="24" width="24"></a> <a href="#" onclick="doGTranslate('tr|es');return false;" class="gflag nturl" style="background-position:-600px -200px;"> <img src="http://joomla-gtranslate.googlecode.com/svn/trunk/mod_gtranslate/tmpl/lang/blank.png" height="24" width="24"></a> <a href="#" onclick="doGTranslate('tr|uk');return false;" class="gflag nturl" style="background-position:-100px -400px;"> <img src="http://joomla-gtranslate.googlecode.com/svn/trunk/mod_gtranslate/tmpl/lang/blank.png" height="24" width="24"></a> 

ve hepsi bu kadar. siteniz artık istediğiniz dile çeviri yapabilecek.

Aşağıdaki kod bloğunu bütün olarakta istediğiniz yere ekleyebilirsiniz.

 <center><!-- GTranslate: http://gtranslate.net/ --> <style type="text/css"> <!-- a.gflag {vertical-align:middle;font-size:24px;padding:1px 0;background-repeat:no-repeat;background-image:url('http://joomla-gtranslate.googlecode.com/svn/trunk/mod_gtranslate/tmpl/lang/24.png');} a.gflag img {border:0;} a.gflag:hover {background-image:url('http://joomla-gtranslate.googlecode.com/svn/trunk/mod_gtranslate/tmpl/lang/24a.png');} #goog-gt-tt {display:none !important;} .goog-te-banner-frame {display:none !important;} .goog-te-menu-value:hover {text-decoration:none !important;} body {top:0 !important;} #google_translate_element2 {display:none!important;} --> </style> <div id="google_translate_element2"> <div class="skiptranslate goog-te-gadget" dir="ltr"> <div id=":0.targetLanguage"> <script type="text/javascript"> function googleTranslateElementInit2() {new google.translate.TranslateElement({pageLanguage: 'tr',autoDisplay: false}, 'google_translate_element2');} </script><script type="text/javascript" src="http://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit2"></script> <script type="text/javascript"> /* <![CDATA[ */ eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))}; if(!''.replace(/^/,String)){while(c--)r[e(c)]=k||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'}; c=1};while(c--)if(k)p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k);return p} ('6 7(a,b){n{4(2.9){3 c=2.9("o");c.p(b,f,f);a.q(c)}g{3 c=2.r();a.s(\'t\'+b,c)}}u(e){}}6 h(a){4(a.8)a=a.8;4(a==\'\')v;3 b=a.w(\'|\')[1];3 c;3 d=2.x(\'y\');z(3 i=0;i<d.5;i++)4(d[i].A==\'B-C-D\')c=d[i];4(2.j(\'k\')==E||2.j(\'k\').l.5==0||c.5==0||c.l.5==0){F(6(){h(a)},G)}g{c.8=b;7(c,\'m\');7(c,\'m\')}}',43,43,'||document|var|if|length|function|GTranslateFireEvent|value|createEvent||||||true|else|doGTranslate||getElementById|google_translate_element2|innerHTML|change|try|HTMLEvents|initEvent|dispatchEvent|createEventObject|fireEvent|on|catch|return|split|getElementsByTagName|select|for|className|goog|te|combo|null|setTimeout|500'.split('|'),0,{})) /* ]]> */ </script> <script type="text/javascript" src="http://joomla-gtranslate.googlecode.com/svn/trunk/gt_update_notes0.js"></script></center> <a href="#" onclick="doGTranslate('tr|tr');return false;" class="gflag nturl" style="background-position:-100px -500px;"> <img src="http://joomla-gtranslate.googlecode.com/svn/trunk/mod_gtranslate/tmpl/lang/blank.png" height="24" width="24"></a> <a href="#" onclick="doGTranslate('tr|az');return false;" class="gflag nturl" style="background-position:-500px -600px;"> <img src="http://joomla-gtranslate.googlecode.com/svn/trunk/mod_gtranslate/tmpl/lang/blank.png" height="24" width="24"></a> <a href="#" onclick="doGTranslate('tr|bg');return false;" class="gflag nturl" style="background-position:-200px -0px;"> <img src="http://joomla-gtranslate.googlecode.com/svn/trunk/mod_gtranslate/tmpl/lang/blank.png" height="24" width="24"></a> <a href="#" onclick="doGTranslate('tr|nl');return false;" class="gflag nturl" style="background-position:-0px -100px;"> <img src="http://joomla-gtranslate.googlecode.com/svn/trunk/mod_gtranslate/tmpl/lang/blank.png" height="24" width="24"></a> <a href="#" onclick="doGTranslate('tr|en');return false;" class="gflag nturl" style="background-position:-0px -0px;"> <img src="http://joomla-gtranslate.googlecode.com/svn/trunk/mod_gtranslate/tmpl/lang/blank.png" height="24" width="24"></a> <a href="#" onclick="doGTranslate('tr|fr');return false;" class="gflag nturl" style="background-position:-200px -100px;"> <img src="http://joomla-gtranslate.googlecode.com/svn/trunk/mod_gtranslate/tmpl/lang/blank.png" height="24" width="24"></a> <a href="#" onclick="doGTranslate('tr|de');return false;" class="gflag nturl" style="background-position:-300px -100px;"> <img src="http://joomla-gtranslate.googlecode.com/svn/trunk/mod_gtranslate/tmpl/lang/blank.png" height="24" width="24"></a> <a href="#" onclick="doGTranslate('tr|el');return false;" class="gflag nturl" style="background-position:-400px -100px;"> <img src="http://joomla-gtranslate.googlecode.com/svn/trunk/mod_gtranslate/tmpl/lang/blank.png" height="24" width="24"></a> <a href="#" onclick="doGTranslate('tr|it');return false;" class="gflag nturl" style="background-position:-600px -100px;"> <img src="http://joomla-gtranslate.googlecode.com/svn/trunk/mod_gtranslate/tmpl/lang/blank.png" height="24" width="24"></a> <a href="#" onclick="doGTranslate('tr|no');return false;" class="gflag nturl" style="background-position:-100px -200px;"> <img src="http://joomla-gtranslate.googlecode.com/svn/trunk/mod_gtranslate/tmpl/lang/blank.png" height="24" width="24"></a> <a href="#" onclick="doGTranslate('tr|pt');return false;" class="gflag nturl" style="background-position:-300px -200px;"> <img src="http://joomla-gtranslate.googlecode.com/svn/trunk/mod_gtranslate/tmpl/lang/blank.png" height="24" width="24"></a> <a href="#" onclick="doGTranslate('tr|ro');return false;" class="gflag nturl" style="background-position:-400px -200px;"> <img src="http://joomla-gtranslate.googlecode.com/svn/trunk/mod_gtranslate/tmpl/lang/blank.png" height="24" width="24"></a> <a href="#" onclick="doGTranslate('tr|ru');return false;" class="gflag nturl" style="background-position:-500px -200px;"> <img src="http://joomla-gtranslate.googlecode.com/svn/trunk/mod_gtranslate/tmpl/lang/blank.png" height="24" width="24"></a> <a href="#" onclick="doGTranslate('tr|sr');return false;" class="gflag nturl" style="background-position:-600px -300px;"> <img src="http://joomla-gtranslate.googlecode.com/svn/trunk/mod_gtranslate/tmpl/lang/blank.png" height="24" width="24"></a> <a href="#" onclick="doGTranslate('tr|es');return false;" class="gflag nturl" style="background-position:-600px -200px;"> <img src="http://joomla-gtranslate.googlecode.com/svn/trunk/mod_gtranslate/tmpl/lang/blank.png" height="24" width="24"></a> <a href="#" onclick="doGTranslate('tr|uk');return false;" class="gflag nturl" style="background-position:-100px -400px;"> <img src="http://joomla-gtranslate.googlecode.com/svn/trunk/mod_gtranslate/tmpl/lang/blank.png" height="24" width="24"></a>