| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Language Translation box using google - simple mod | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||||
|
|||||||||
Language Translation box using google - simple mod
As the web has spread across the world, more and more web pages are available in languages other than English. Google provides a translation link and language tools to enable you to read pages written in unfamiliar languages.
Google translates pages by computer. Machine translation is difficult to do well and tends not to be as clear as human translation. But it can give you the gist of what’s written or suggestions for translating something into another language. This works fine with Mozilla Firefox, opera9 and explorer Here is a very simple modification for a language translation box to be placed on your main x-cart ENGLISH (EN) home page. First of all it looks like this: http://www.shishapipe.net/images/xcartlangbox.jpg If you want to see it in action go to http://www.shishapipe.net/shopcart/home.php it's on the left hand side half way down. All you need is the NEW language.tpl file which is below and also attached xcart_language.zip. Save this file in the directory skin1/customer/language.tpl language.tpl HTML Code:
Information on items in the above code for you to understand the code better: What is http://64.233.179.104/translate_c?hl=en ? This is the IP address for the Google translate URL, this tells Google that we are translating from a English page (en) What is UTF-8 in the code ? UTF-8 (8-bit UCS/Unicode Transformation Format) is a variable-length character encoding for Unicode. It is able to represent any character in the Unicode standard, yet the initial encoding of byte codes and character assignments for UTF-8 is backwards compatible with ASCII. For these reasons, it is steadily becoming the preferred encoding for e-mail, web pages, and other places where characters are stored or streamed. What is langpair=en%7Cfr in the code ? In the above code we have the language pairs: langpair=en%7Cfr = English (en) to French (fr) langpair=en%7Cde = English (en) to Deutsch (de) langpair=en%7Ces = English (en) to Espanol (es) langpair=en%7Cru = English (en) to Russian (ru) langpair=en%7Car = English (en) to Arabic (ar) langpair=en%7Cpt = English (en) to Portugues (pt) langpair=en%7Cko = English (en) to Korea (ko) langpair=en%7Cit = English (en) to Italian (it) What is http://www.YOUR_WEB_ADDRESS/home.php ? This is the url of the page you want Google to start to translate. Next you need the images for the flags (Image size 30 x 20 pixels), Because you can only attach 4 images to a post in this forum I have included a downloadable file which has the language.tpl file included - xcart_language.zip You can get more flag images from http://www.google.com/language_tools (scroll down and you can find 159 flags) http://www.shishapipe.net/shopcart/images/french.gif http://www.shishapipe.net/shopcart/images/italian.gif http://www.shishapipe.net/shopcart/images/german.gif All you need to do now is edit your skin1/customer/home.tpl by placing a link where you want the language.tpl file to be displayed. Code:
That's it, you DO NOT need to make a language label as there is already one in the x-cart default software. If anyone has any other web site translation codes better than this, please post them here for us to look at. For example the Alta Vista Babel Fish site, at http://www.altavista.com/help/free/free_searchbox_transl maybe better than Google for translating, I really do not know but always open to any suggestions on either the above code or other sites.
__________________
Apache/2.0.55 (Red Hat) & MYSQL Server: 5.0.24 PERL: 5.008005 / PHP: 4.4.4 - 4.3.1 X-CART Shop carts at http://www.nightscene.co.uk/shop/home.php http://www.theshisha.net/shopcart/home.php http://www.system-maintenance.com/maint/home.php http://www.tabac4u.com |
|||||||||
#2
|
|||||||
|
|||||||
Re: Language Translation box using google - simple mod
can you post the code that you have in your site, Ican't get it to be in dropdown like yours
__________________
4.0.16 |
|||||||
#3
|
|||||||
|
|||||||
Re: Language Translation box using google - simple mod
Does anyone has a Chinese language pack in dropdown?
__________________
Version 4.1.10 |
|||||||
#4
|
|||||||
|
|||||||
Re: Language Translation box using google - simple mod
The drop down language thing on his site is the original xcart language module. The thing he's posting about is farther down the page. It's listed in a menu box like bestsellers.
__________________
X-Cart Gold 4.1.10 www.oldworlddistributors.com - Live Store www.coppercakestands.com - Live Store -- My Website - www.frodesigns.com |
|||||||
|
|||
X-Cart forums © 2001-2020
|