News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Google Translation by BurkeKnight Enterprises

Started by Burke ♞ Knight, December 21, 2008, 06:03:02 PM

Previous topic - Next topic

I AM Legend

Bump.
Sorry for bumping, been 3 days now,
Quote from: Sabre™ on January 02, 2009, 06:25:38 PM
I was convinced to hide this from users, as they cannot use it, only guests, so moved the code up a lil so only guests see this. It made more sense.

So instead of
</form>';
}

echo '
<a href="http://www.google.com/translate_c?hl=en&amp;langpair=en%7Cfr&amp;u=', $scripturl, '"><img src="', $settings['images_url'], '/franceflag.png" alt="', $txt['bksmf_french'], '" title="', $txt['bksmf_french'], '" width="24" height="24" style="border: 0px solid ; width: 24px; height: 24px;" /></a> <a href="http://www.google.com/translate_c?hl=en&amp;langpair=en%7Cde&amp;u=', $scripturl, '"><img src="', $settings['images_url'], '/germanflag.png" alt="', $txt['bksmf_german'], '" title="', $txt['bksmf_german'], '" width="24" height="24" style="border: 0px solid ; width: 24px; height: 24px;" /></a> <a href="http://www.google.com/translate_c?hl=en&amp;langpair=en%7Cit&amp;u=', $scripturl, '"><img src="', $settings['images_url'], '/italyflag.png" alt="', $txt['bksmf_italian'], '" title="', $txt['bksmf_italian'], '" width="24" height="24" style="border: 0px solid ; width: 24px; height: 24px;" /></a> <a href="http://www.google.com/translate_c?hl=en&amp;langpair=en%7Cnl&amp;u=', $scripturl, '"><img src="', $settings['images_url'], '/netherlandsflag.png" alt="', $txt['bksmf_dutch'], '" title="', $txt['bksmf_dutch'], '" width="24" height="24" style="border: 0px solid ; width: 24px; height: 24px;" /></a> <a href="http://www.google.com/translate_c?hl=en&amp;langpair=en%7Ces&amp;u=', $scripturl, '"><img src="', $settings['images_url'], '/spainflag.png" alt="', $txt['bksmf_spanish'], '" title="', $txt['bksmf_spanish'], '" width="24" height="24" style="border: 0px solid ; width: 24px; height: 24px;" /></a> <a href="http://www.google.com/translate_c?hl=en&amp;langpair=en%7Cpt&amp;u=', $scripturl, '"><img src="', $settings['images_url'], '/portugalflag.png" alt="', $txt['bksmf_portuguese'], '" title="', $txt['bksmf_portuguese'], '" width="24" height="24" style="border: 0px solid ; width: 24px; height: 24px;" /></a> <a href="http://www.google.com/translate_c?hl=en&amp;langpair=en%7Cko&amp;u=', $scripturl, '"><img src="', $settings['images_url'], '/koreaflag.png" alt="', $txt['bksmf_korean'], '" title="', $txt['bksmf_korean'], '" width="24" height="24" style="border: 0px solid ; width: 24px; height: 24px;" /></a> <a href="http://www.google.com/translate_c?hl=en&amp;langpair=en%7Czh-CN&amp;u=', $scripturl, '"><img src="', $settings['images_url'], '/chinaflag.png" alt="', $txt['bksmf_chinese'], '" title="', $txt['bksmf_chinese'], '" width="24" height="24" style="border: 0px solid ; width: 24px; height: 24px;" /></a> <a href="http://www.google.com/translate_c?hl=en&amp;langpair=en%7Cja&amp;u=', $scripturl, '"><img src="', $settings['images_url'], '/japanflag.png" alt="', $txt['bksmf_japanese'], '" title="', $txt['bksmf_japanese'], '" width="24" height="24" style="border: 0px solid ; width: 24px; height: 24px;" /></a> <a href="http://www.google.com/translate_c?hl=en&amp;langpair=en%7Cel&amp;u=', $scripturl, '"><img src="', $settings['images_url'], '/greeceflag.png" alt="', $txt['bksmf_greek'], '" title="', $txt['bksmf_greek'], '" width="24" height="24" style="border: 0px solid ; width: 24px; height: 24px;" /></a> <a href="http://www.google.com/translate_c?hl=en&amp;langpair=en%7Car&amp;u=', $scripturl, '"><img src="', $settings['images_url'], '/arabflag.png" alt="', $txt['bksmf_arabic'], '" title="', $txt['bksmf_arabic'], '" width="24" height="24" style="border: 0px solid ; width: 24px; height: 24px;" /></a> <a href="http://www.google.com/translate_c?hl=en&amp;langpair=en%7Cru&amp;u=', $scripturl, '"><img src="', $settings['images_url'], '/russiaflag.png" alt="', $txt['bksmf_russian'], '" title="', $txt['bksmf_russian'], '" width="24" height="24" style="border: 0px solid ; width: 24px; height: 24px;" /></a></td>
</tr>
</table>
</td>
</tr>
</table>';


I have
</form>
<a href="http://www.google.com/translate_c?hl=en&amp;langpair=en%7Cfr&amp;u=', $scripturl, '"><img src="', $settings['images_url'], '/franceflag.png" alt="', $txt['bksmf_french'], '" title="', $txt['bksmf_french'], '" width="24" height="24" style="border: 0px solid ; width: 24px; height: 24px;" /></a> <a href="http://www.google.com/translate_c?hl=en&amp;langpair=en%7Cde&amp;u=', $scripturl, '"><img src="', $settings['images_url'], '/germanflag.png" alt="', $txt['bksmf_german'], '" title="', $txt['bksmf_german'], '" width="24" height="24" style="border: 0px solid ; width: 24px; height: 24px;" /></a> <a href="http://www.google.com/translate_c?hl=en&amp;langpair=en%7Cit&amp;u=', $scripturl, '"><img src="', $settings['images_url'], '/italyflag.png" alt="', $txt['bksmf_italian'], '" title="', $txt['bksmf_italian'], '" width="24" height="24" style="border: 0px solid ; width: 24px; height: 24px;" /></a> <a href="http://www.google.com/translate_c?hl=en&amp;langpair=en%7Cnl&amp;u=', $scripturl, '"><img src="', $settings['images_url'], '/netherlandsflag.png" alt="', $txt['bksmf_dutch'], '" title="', $txt['bksmf_dutch'], '" width="24" height="24" style="border: 0px solid ; width: 24px; height: 24px;" /></a> <a href="http://www.google.com/translate_c?hl=en&amp;langpair=en%7Ces&amp;u=', $scripturl, '"><img src="', $settings['images_url'], '/spainflag.png" alt="', $txt['bksmf_spanish'], '" title="', $txt['bksmf_spanish'], '" width="24" height="24" style="border: 0px solid ; width: 24px; height: 24px;" /></a> <a href="http://www.google.com/translate_c?hl=en&amp;langpair=en%7Cpt&amp;u=', $scripturl, '"><img src="', $settings['images_url'], '/portugalflag.png" alt="', $txt['bksmf_portuguese'], '" title="', $txt['bksmf_portuguese'], '" width="24" height="24" style="border: 0px solid ; width: 24px; height: 24px;" /></a> <a href="http://www.google.com/translate_c?hl=en&amp;langpair=en%7Cko&amp;u=', $scripturl, '"><img src="', $settings['images_url'], '/koreaflag.png" alt="', $txt['bksmf_korean'], '" title="', $txt['bksmf_korean'], '" width="24" height="24" style="border: 0px solid ; width: 24px; height: 24px;" /></a> <a href="http://www.google.com/translate_c?hl=en&amp;langpair=en%7Czh-CN&amp;u=', $scripturl, '"><img src="', $settings['images_url'], '/chinaflag.png" alt="', $txt['bksmf_chinese'], '" title="', $txt['bksmf_chinese'], '" width="24" height="24" style="border: 0px solid ; width: 24px; height: 24px;" /></a> <a href="http://www.google.com/translate_c?hl=en&amp;langpair=en%7Cja&amp;u=', $scripturl, '"><img src="', $settings['images_url'], '/japanflag.png" alt="', $txt['bksmf_japanese'], '" title="', $txt['bksmf_japanese'], '" width="24" height="24" style="border: 0px solid ; width: 24px; height: 24px;" /></a> <a href="http://www.google.com/translate_c?hl=en&amp;langpair=en%7Cel&amp;u=', $scripturl, '"><img src="', $settings['images_url'], '/greeceflag.png" alt="', $txt['bksmf_greek'], '" title="', $txt['bksmf_greek'], '" width="24" height="24" style="border: 0px solid ; width: 24px; height: 24px;" /></a> <a href="http://www.google.com/translate_c?hl=en&amp;langpair=en%7Car&amp;u=', $scripturl, '"><img src="', $settings['images_url'], '/arabflag.png" alt="', $txt['bksmf_arabic'], '" title="', $txt['bksmf_arabic'], '" width="24" height="24" style="border: 0px solid ; width: 24px; height: 24px;" /></a> <a href="http://www.google.com/translate_c?hl=en&amp;langpair=en%7Cru&amp;u=', $scripturl, '"><img src="', $settings['images_url'], '/russiaflag.png" alt="', $txt['bksmf_russian'], '" title="', $txt['bksmf_russian'], '" width="24" height="24" style="border: 0px solid ; width: 24px; height: 24px;" /></a>';
}

echo '
                   </td>
</tr>
</table>
</td>
</tr>
</table>';


so now only guests see this.



what php file is this edit in?

thanks.

Burke ♞ Knight

Index.template.php of the default theme.


mockingbird

#23
First of all: tnx for this mod. I had to apply manually, but it wasn't that hard :)

Hmmm, clicking one of the flags always makes it go back to the main index.php of the forum. Is there a way to make it show the translated version of the page we are on currently?

I guess $scripturl should be changed to something else? Like $currenturl? dunno?

PS: dunno if it matters, but we have the search-engine friendly url feature enabled.


mockingbird

super ganz geil total uber toll mega banana bump

TheListener

the index template failed  :(

How do I install this manually?

Realinfo

http://www.melindaspenpals.com/penpal-community/index.php

Sir I saw this site...........they have 14 Flags, but my site only has 12 flags............ and also I want flags' postion in Center............. also I want light Green colour on background of flags not white colour......................

Sabre™

@ TheListener
Do you still require assistance?

@ Realinfo
Something like this?


or this?



I moved the flags above the shrink button in the second image, so if that area is shrunk the flags will still be visible.
Someone may come up with a more satisfying layout for you, but this is all I could achieve with my limited knowledge and no template lol

Just post your index.template.php if you'd like me to assist you :)
Do NOT give admin and/or ftp details to just anybody, see if they are trust worthy first!!  Do your homework ;)


ttuu

u can add Hebrew translation.

this is the code:

<a href="http://www.google.com/translate_c?hl=en&langpair=en%7Ciw&u=', $scripturl, '"><img src="', $settings['images_url'], '/Hebrewflag.png" alt="', $txt['bksmf_Hebrew'], '" title="', $txt['bksmf_Hebrew'], '" width="24" height="24" style="border: 0px solid ; width: 24px; height: 24px;" /></a>

and image flag is attached

TheListener

Quote from: TheListener on May 01, 2009, 09:37:36 PM
the index template failed  :(

How do I install this manually?

Hello Sabre have I seen you somewhere before?  ;D

The mod installed perfect although when I had a nosy at another language some of the tabs were missing ie home.

How do I rectify this?

Sabre™

No idea mate.
I can purely speculate that it is a problem with google translator processing your site.
But that's just like saying that "I am such a great specimen of a man, because God needed a gift to give to women", when in fact, I don't know why.  lol

Similar and/or the same happens for other sites also.
Do NOT give admin and/or ftp details to just anybody, see if they are trust worthy first!!  Do your homework ;)


TheListener

Is there a way to add flags to the mod?


TheListener


bbmtalk

#34
Quote from: TheListener on July 28, 2009, 01:27:18 PM
Is there a way to add flags to the mod?

Yes see #29.

1. You can add the link and edit the language (the one in red) which you want to translate.

<a href="http://www.google.com/translate_c?hl=en&langpair=en%7Ciw&u=', $scripturl, '"><img src="', $settings['images_url'], '/yourgflag.png" alt="', $txt['bksmf_yourlangauge'], '" title="', $txt['bksmf_yourlanguage'], '" width="24" height="24" style="border: 0px solid ; width: 24px; height: 24px;" /></a> 

Also modify Modifications.english.php to add

$txt['bksmf_yourlanguage'] = 'yourlanguage';

3. upload the flag to themes/default/images

-------------------------------

One question - if I want place them in the bottom (above the powered by....) and centered, what are the codes to use?


wonslung

I have a problem, when i click a flag it seems to log out and translate only the index page, some forums are hidden to guests.  Is there anyway to make this stay logged in so it will translate that page?

scimmiotto

is there any translation of this mod for 20. rc2?
Loop code example:
The following statement is FALSE
The previous statement is TRUE.

blokey

#37
Yeah I am running RC2
It has taken me a while but I have achieved this,,,,,

I have posted my index template as suggested,, so i may be able to achieve an inline group of flags.
SMF Version 2.0 RC2     Server Info Apache version 2.0.63 PHP version 5.2.9 MySQL version 5.0.81-community Architecture x86_64 Operating system Linux

Sabre™

In your index.css, search for this
div#upper_section div.user {
float:left;
overflow:auto;
width:50%;
}


and change the width percentage to 55
div#upper_section div.user {
float:left;
overflow:auto;
width:55%;
}
Do NOT give admin and/or ftp details to just anybody, see if they are trust worthy first!!  Do your homework ;)


blokey

SMF Version 2.0 RC2     Server Info Apache version 2.0.63 PHP version 5.2.9 MySQL version 5.0.81-community Architecture x86_64 Operating system Linux

Advertisement: