Jump to content
Sign in to follow this  
azer

babelfish infobox

Recommended Posts

the contribution is here :

 

http://www.oscommerce.com/community/contributions,1761

 

This file just replaces the languages infobox with a Babelfish translation box. Should be used only if you have only one language installed!

 

 

 

here is one question :

this is a fantastic contribution , but do you think it si possible to add all other language that babel propose ? also does babel is able to understand from wich langugae the customer is coming, i mean if i have a french shop , will it understand im coming from french and want to have a spanish transalation


MS2

Share this post


Link to post
Share on other sites
the contribution is here :

 

http://www.oscommerce.com/community/contributions,1761

 

This file just replaces the languages infobox with a Babelfish translation box. Should be used only if you have only one language installed!

here is one question :

this is a fantastic contribution , but do you think it si possible to add all other language that babel propose ? also does babel is able to understand from wich langugae the customer is coming, i mean if i have a french shop , will it understand im coming from french and want to have a spanish transalation

Just corrected some spelling errors in the package, nothing more.

 

I should be easy enough to add other languages. Its just a case of having the images and adding something like

<tr>

<td><font size=1><a target="_blank" href="http://babelfish.altavista.com/babelfish/tr?doit=done&url='. $_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"] .'&lp=en_ja">Martian</a><br></td>

<td><img src="images/languages/martian.gif" border="0"></td>

</tr>


The Coopco Underwear Shop

 

If you live to be 100 years of age, that means you have lived for 36,525 days. Don't waste another, there aren't many left.

Share this post


Link to post
Share on other sites

here are my ideas :

 

1. this contribution for the moment are done for english to other language, while in babelfish it s possible to go from other language than english to other language , for the moment the url after a click i s always finisihing like this en_fr or en_zh or en_zh , i think we could use the language varialbe for each laguage that we have in a multilangual shop

 

2. i don't understand why repalce the language boxe, i got severa lanuage alreday on my shop , i created a box called babelbox.php

 

3. ill try to add new language to the box , and i think we should try to make some hack to be able for each language wich desitnation language we could propose ... for the moment we could make a list of the source and destination language avalaible in babelfish and make some use of testing with a CASE in the box

 

i wait for your thinking! :rolleyes:


MS2

Share this post


Link to post
Share on other sites
here are my ideas :

 

1. this contribution for the moment are done for english to other language, while in babelfish it s possible to go from other language than english to other language , for the moment the url after a click i s always finisihing like this en_fr or en_zh or en_zh , i think we could use the language varialbe for each laguage that we have in a multilangual shop

 

2. i don't understand why repalce the language boxe, i got severa lanuage alreday on my shop , i created a box called babelbox.php

 

3. ill try to add new language to the box , and i think we should try to make some hack to be able for each language wich desitnation language we could propose ... for the moment we could make a list of the source and destination language avalaible in babelfish and make some use of testing with a CASE in the box

 

i wait for your thinking! :rolleyes:

OK, I think I understand now.

1.. at babelish, you can get

From French

Cut and paste this line of html into your page:

 

<script language="JavaScript1.2" src="http://www.altavista.com/static/scripts/translate_french.js"></script>

 

From English

Cut and paste this line of html into your page:

 

<script language="JavaScript1.2" src="http://www.altavista.com/static/scripts/translate_engl.js"></script>

 

and so on for German Spanish and Portugese

 

I tried the english option, but it messed up my SSL beause it is not relative addressing for the images.

 

Or you can get

Cut and paste this html into your page:

 

<script type="text/javascript" language="JavaScript1.2" src="http://www.altavista.com/help/free/inc_translate"></script>

<noscript><a href="http://www.altavista.com/babelfish/tr"></noscript>

 

Should have something that says that by using it you agree to the terms and conditions of Altavista.

PLEASE NOTE: You may not modify the graphics, HTML or AltaVista logo in any way, or use the AltaVista logo for any other purpose. AltaVista does not provide compensation to Webmasters who use this free service. You agree to these terms when you click on an "I want this one!" button above.

 

Maybe need permission from them to do it.

 

2.. I suppose the language box is redundant for those like me that are not multiligual. Your solution is better though. Maybe call it Babelfish Box.

 

3.. OK, I can do testing if you like.


The Coopco Underwear Shop

 

If you live to be 100 years of age, that means you have lived for 36,525 days. Don't waste another, there aren't many left.

Share this post


Link to post
Share on other sites

thanks for the fast feedback

 

here is what i've done , i defined a variable in each language because i dont know what is the name of the variable that give en for english , fr for french, nl for dutch

 

and then in the infobox i test to see the suffix value then , i change the link depending of the language and removed the link that are the translation for the same language as the source :

 

here is my code

<?php
/*
 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License

 Babelfish mod to languages.php, Babelfish mod v2.0a

 This is not part of the official release of osCommerce.

 Babelfish is a registered trademark of Altavista.

*/
?>

<!-- languages //-->
	<tr>
		<td>

<?php
 $info_box_contents = array();
 $info_box_contents[] = array('text' => BOX_HEADING_BABELBOX );

 new infoBoxHeading($info_box_contents, false, false);

 $info_box_contents = array();

if (AZER_LANGUAGE_SUFFIXE == 'en') {

 $info_box_contents[] = array('text' => '

<!-- BEGIN ALL EDITING -->

<table width="100%" border="0">
 <tr>
<td><font size=1><a target="_blank" href="http://babelfish.altavista.com/babelfish/tr?doit=done&url='. $_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"] .'&lp=' . AZER_LANGUAGE_SUFFIXE . '_de">Deutsch</a></td>
<td><img src="images/languages/german.gif" border="0"></td>
 </tr>
<tr>
<td><font size=1><a target="_blank" href="http://babelfish.altavista.com/babelfish/tr?doit=done&url='. $_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"] .'&lp=' . AZER_LANGUAGE_SUFFIXE . '_el">Grec</a></td>
<td><img src="images/languages/gr.gif" border="0"></td>
 </tr>
 <tr>
<td><font size=1><a target="_blank" href="http://babelfish.altavista.com/babelfish/tr?doit=done&url='. $_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"] .'&lp=' . AZER_LANGUAGE_SUFFIXE . '_it">Italiano</a><br></td>
<td><img src="images/languages/italian.gif" border="0"></td>
 </tr>
 <tr>
<td><font size=1><a target="_blank" href="http://babelfish.altavista.com/babelfish/tr?doit=done&url='. $_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"] .'&lp=' . AZER_LANGUAGE_SUFFIXE . '_es">Espa?ol</a></td>
<td><img src="images/languages/spanish.gif" border="0"></td>
 </tr>
 <tr>
<td><font size=1><a target="_blank" href="http://babelfish.altavista.com/babelfish/tr?doit=done&url='. $_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"] .'&lp=' . AZER_LANGUAGE_SUFFIXE . '_pt">Portuguese</a><br></td>
<td><img src="images/languages/portuguese.gif" border="0"></td>
 </tr>
<tr>
<td><font size=1><a target="_blank" href="http://babelfish.altavista.com/babelfish/tr?doit=done&url='. $_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"] .'&lp=' . AZER_LANGUAGE_SUFFIXE . '_ru">Russian</a><br></td>
<td><img src="images/languages/ru.gif" border="0"></td>
 </tr>
 <tr>
<td><font size=1><a target="_blank" href="http://babelfish.altavista.com/babelfish/tr?doit=done&url='. $_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"] .'&lp=' . AZER_LANGUAGE_SUFFIXE . '_zh">Chinese</a><br></td>
<td><img src="images/languages/chinese.gif" border="0"></td>
 </tr>
 <tr>
<td><font size=1><a target="_blank" href="http://babelfish.altavista.com/babelfish/tr?doit=done&url='. $_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"] .'&lp=' . AZER_LANGUAGE_SUFFIXE .'_ko">Korean</a><br></td>
<td><img src="images/languages/korean.gif" border="0"></td>
 </tr>
 <tr>
<td><font size=1><a target="_blank" href="http://babelfish.altavista.com/babelfish/tr?doit=done&url='. $_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"] .'&lp=' . AZER_LANGUAGE_SUFFIXE . '_ja">Japanese</a><br></td>
<td><img src="images/languages/japanese.gif" border="0"></td>
 </tr>
</table>

<!-- FINISH ALL EDITING -->

');
}

if (AZER_LANGUAGE_SUFFIXE == 'fr') {
 $info_box_contents[] = array('text' => '

<!-- BEGIN ALL EDITING -->

<table width="100%" border="0">


 <tr>
<td><font size=1><a target="_blank" href="http://babelfish.altavista.com/babelfish/tr?doit=done&url='. $_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"] .'&lp=' . AZER_LANGUAGE_SUFFIXE . '_de">Deutsch</a></td>
<td><img src="images/languages/german.gif" border="0"></td>
 </tr>
 <tr>
<td><font size=1><a target="_blank" href="http://babelfish.altavista.com/babelfish/tr?doit=done&url='. $_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"] .'&lp=' . AZER_LANGUAGE_SUFFIXE . '_el">Grec</a></td>
<td><img src="images/languages/gr.gif" border="0"></td>
 </tr>
  <tr>
<td><font size=1><a target="_blank" href="http://babelfish.altavista.com/babelfish/tr?doit=done&url='. $_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"] .'&lp=' . AZER_LANGUAGE_SUFFIXE . '_it">Italiano</a><br></td>
<td><img src="images/languages/italian.gif" border="0"></td>
 </tr>
 <tr>
<td><font size=1><a target="_blank" href="http://babelfish.altavista.com/babelfish/tr?doit=done&url='. $_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"] .'&lp=' . AZER_LANGUAGE_SUFFIXE . '_es">Espa?ol</a></td>
<td><img src="images/languages/spanish.gif" border="0"></td>
 </tr>
 <tr>
<td><font size=1><a target="_blank" href="http://babelfish.altavista.com/babelfish/tr?doit=done&url='. $_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"] .'&lp=' . AZER_LANGUAGE_SUFFIXE . '_pt">Portuguese</a><br></td>
<td><img src="images/languages/portuguese.gif" border="0"></td>
 </tr>
</table>

<!-- FINISH ALL EDITING -->

');
}


 new infoBox($info_box_contents);
?>
		</td>
	  </tr>
<!-- languages_eof //-->

 

i hope you could advice me a better code !

 

as you can see i added russian and greek and found the image in my admin/flags folder that i use from the contribution whos online + flag


MS2

Share this post


Link to post
Share on other sites

now a llitle bit trecky :

 

i got serveral language , and i have english also , since there are more language automatic translation , i need that when someone would click on the japonese translator from other language than english that it launch the link as it would be from the english page (i see when u pass from a language to english in the shop the url then is : http:// .../shop/index.php?language=en&osCsid=346d2ddb


MS2

Share this post


Link to post
Share on other sites
thanks for the fast feedback

 

here is what i've done , i defined a variable in each language because i dont know what is the name of the variable that give en for english , fr for french, nl for dutch

 

and then in the infobox i test to see the suffix value then , i change the link depending of the language and removed the link that are the translation for the same language as the source :

 

here is my code

I tried the code and I just get an empty box.

 

I don't know php but where would it get

if (AZER_LANGUAGE_SUFFIXE == 'en') {


The Coopco Underwear Shop

 

If you live to be 100 years of age, that means you have lived for 36,525 days. Don't waste another, there aren't many left.

Share this post


Link to post
Share on other sites
I don't know php but where would it get

if (AZER_LANGUAGE_SUFFIXE == 'en') {

 

i defined ine the language file

 

catalog\includes\languages\french.php

define('AZER_LANGUAGE_SUFFIXE', 'fr'); // for french

 

catalog\includes\languages\englsih.php

define('AZER_LANGUAGE_SUFFIXE', 'en'); // for englsih


MS2

Share this post


Link to post
Share on other sites
i defined ine the language file

 

catalog\includes\languages\french.php

define('AZER_LANGUAGE_SUFFIXE', 'fr'); // for french

 

catalog\includes\languages\englsih.php

define('AZER_LANGUAGE_SUFFIXE', 'en'); // for englsih

Yes, it works for english to the other languages.

 

The line

$info_box_contents[] = array('text' => BOX_HEADING_BABELBOX );

did not work, so I changed it to

$info_box_contents[] = array('text' => 'Babelfish');

 

Go to coopco.com.au/catalog to see it.


The Coopco Underwear Shop

 

If you live to be 100 years of age, that means you have lived for 36,525 days. Don't waste another, there aren't many left.

Share this post


Link to post
Share on other sites
Yes, it works for english to the other languages.

 

The line

$info_box_contents[] = array('text' => BOX_HEADING_BABELBOX );

did not work, so I changed it to

$info_box_contents[] = array('text' => 'Babelfish');

 

Go to coopco.com.au/catalog to see it.

Changed

$info_box_contents[] = array('text' => 'Babelfish');

to

$info_box_contents[] = array('text' => 'Babelfish Translation');

 

and now have the flags


The Coopco Underwear Shop

 

If you live to be 100 years of age, that means you have lived for 36,525 days. Don't waste another, there aren't many left.

Share this post


Link to post
Share on other sites

yes i know it work from english to other language, but it think u didnt get , i would like for other language that for non available translation , when u click on the flag it change the babel link to add the english language url ... hope u get me !


MS2

Share this post


Link to post
Share on other sites
yes i know it work from english to other language, but it think u didnt get , i would like for other language that for non available translation , when u click on the flag it change the babel link to add the english language url ... hope u get me !

It will only translate from certain laguages to other certain languages. I do not think that a page in (eg) Swedish would translate to any other language.


The Coopco Underwear Shop

 

If you live to be 100 years of age, that means you have lived for 36,525 days. Don't waste another, there aren't many left.

Share this post


Link to post
Share on other sites

u reallyh dont understrand me , this is what i say , for people having enlgish , and other langage , if someone click on translator from language doesn't hnadle , i would like it to open a link like it was coming from the english page !!!


MS2

Share this post


Link to post
Share on other sites
u reallyh dont understrand me , this is what i say , for people having enlgish , and other langage , if someone click on translator from language doesn't hnadle , i would like it to open a link like it was coming from the english page !!!

Sorry Azer. I am still not clear, and I really would like to assure you that I do not mean to be difficult.

 

I think it may be that I am not sure of where you would like to take this. Do you mean

 

1.. if I was Thai speaking, and I land on a site that is in Croation, and I click on a link that translates the site to Zulu, then the English or French (or other supported translated language) translated page comes up?

 

or

 

2.. if I was Thai speaking, and I click on a link that translates the site to Zulu, then the English or French (etc)translated page comes up?

 

or

 

3.. if I was Thai speaking, the browser determines that Thai is my native language and that language is not supported on the site that I am visiting, whatever flag they click on in the Babelfish box that is not supported brings up the translated English or other supported translated page.

 

I can see that if I was Canadian who was literate in in Thai, and I visited a site that was written in Zulu, and I clicked on the Zulu flag, then either an English or French translation would be good.

 

If you only have the flags of the languages that can be translated in the Babelfish box, there would have to be updates each Babelfish added a language.

 

If you have all of the world flags included, the box would be way too big. And when a flag is changed, there has to be an update.

 

Now, have I again missed the point entirely?


The Coopco Underwear Shop

 

If you live to be 100 years of age, that means you have lived for 36,525 days. Don't waste another, there aren't many left.

Share this post


Link to post
Share on other sites

hahaha yes u miss my point

 

firstable im speaking only of the supported languages of babelfish

 

 

if im chenese and i come on the french page of a weshop that also have english language :

 

I would see the chinese flag and would clik on it

But since babelfish doesnt support french to chenese , the trick would be that , clicking from french language page to chinese flag, would add in the babelfish URL for translation the url of the shop page in english to be translated in chenese that is supported !


MS2

Share this post


Link to post
Share on other sites
hahaha yes u miss my point

 

firstable im speaking only of the supported languages of babelfish

if im chenese and i come on the french page of a weshop that also have english language :

 

I would see the chinese flag and would clik on it

But since babelfish doesnt support french to chenese , the trick would be that , clicking from french language page to chinese flag, would add in the babelfish URL for translation the url of the shop page in english to be translated in chenese that is supported !

 

Ah, it finally dawns on me, and I can see how it can be very useful for mutilingual sites.

 

OK, not knowing coding, I guess you would have to have else statements or similar to work through an array of some sort with some sort of way to get get the information while the process is invisible to the user. Or maybe, in the example you gave, load the site in english and force the translation from there.

 

Maybe the please wait contrib (I have not looked at it) maybe useful here to hide the loading of the site in english.

 

What languages to can be be translated to what languages has to be coded.

 

Anyway, it is all way out of my league, but it is possible.


The Coopco Underwear Shop

 

If you live to be 100 years of age, that means you have lived for 36,525 days. Don't waste another, there aren't many left.

Share this post


Link to post
Share on other sites
Would someone provide a url for a site that has this working? Thank you.

What we are talking about is not working yet.

 

To see the original contrib working, go to police.coopco.com.au/catalog

 

To see waht azer has done so far, go to my test site coopco.com.au/catalog


The Coopco Underwear Shop

 

If you live to be 100 years of age, that means you have lived for 36,525 days. Don't waste another, there aren't many left.

Share this post


Link to post
Share on other sites

Hi,

 

How do you change the text size so it matches the text in OSC?

 

I have tried to change the 'font-weight:normal' to 'font-weight:12px' but this does not seem to work.

 

Any help?

 

Thanx,

Pompeylad.


PHP?!? Long live HTML!!!! But then again we never stop learning.

Share this post


Link to post
Share on other sites
Hi,

 

How do you change the text size so it matches the text in OSC?

 

I have tried to change the 'font-weight:normal' to 'font-weight:12px' but this does not seem to work.

 

Any help?

 

Thanx,

Pompeylad.

 

Instead of font-weight (this is for making the fonts bold face or normal) leave 'font-weight:normal' and use 'font-size: 12px;'

 

The only trouble is that I made this with out thinking about someone wanting a different font size, so to change the font size you'll need to change the image's for Chinese, Japanese and Korean. Because I could not find a font to make them look right so I needed to make them images instead of text and the default size I used is 'font-size: 13px;'.

 

Does that make sense? I could try to make a different size for you and post them, but it will take a while caus I am smapped with PC trouble.

Share this post


Link to post
Share on other sites

That's ok, thanks for the info Joe.

 

I might just leave the flags on there?

 

But the text is the link, not the flags. Would you (or anybody else) know how to link up the flags to Bablefish?


PHP?!? Long live HTML!!!! But then again we never stop learning.

Share this post


Link to post
Share on other sites

My text is smaller and I used this

 

<tr>

<td><font size=1><a href="http://babelfish


The Coopco Underwear Shop

 

If you live to be 100 years of age, that means you have lived for 36,525 days. Don't waste another, there aren't many left.

Share this post


Link to post
Share on other sites

Thanks for the info, but now I just want to leave the flags on there.

 

But the text is the link, not the flags. Would you (or anybody else) know how to link up the flags to Bablefish?

 

Also how do I get the flags to line up against each other? And not in a grid as they are now set out.

 

Thanks,

Pompeylad.


PHP?!? Long live HTML!!!! But then again we never stop learning.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×