Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: Burke ♞ Knight on December 21, 2008, 06:03:02 PM

Title: Google Translation by BurkeKnight Enterprises
Post by: Burke ♞ Knight on December 21, 2008, 06:03:02 PM
Link to Mod (http://custom.simplemachines.org/mods/index.php?mod=1543)

Google Translation by BurkeKnight Enterprises

Version: 2.0 Date: 7/1/13
Compatibility: 1.1.x and 2.0

Made by: BurkeKnight (http://www.simplemachines.org/community/index.php?action=profile;u=150637) - BurkeKnight Enterprises (http://www.burkeknight.com/)

This modification adds Google Translation buttons to the default theme.
There are three different versions:

BK_Modding_Google_Translator_2.0.zip
Places them in the user section, under the Total time logged in line. (1.1.x & 2.0)

BK_Modding_Google_Translator_News_Rep_2.0.zip
Replaces the news box. (2.0 Only)

BK_Modding_Google_Translator_Top_2.0.zip
Replaces the SMF Logo. (2.0 Only)

This mod only changes to the desired language for reading. If login or try to post, it will revert to the default site language.

Languages include:
French
German
Italian
Dutch
Spanish
Portuguese
Korean
Chinese
Japanese
Greek
Arabic
Russian

Support:

If need support for this mod, please go to BurkeKnight Enterprises (http://www.burkeknight.com/) and register there.

We have a support ticket system for mod support.

We will no longer be supporting this mod here at the SMF site,
as we feel it is easier to keep all support at our site.

(http://creativecommons.org/licenses/by-sa/3.0/deed.en_US)
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License (http://creativecommons.org/licenses/by-sa/3.0/deed.en_US).
Title: Re: BK-SMF Google Translation
Post by: Sabre™ on December 22, 2008, 10:53:19 PM
VERY nice!
I dont have multilingual sites, but Im definitely going to give this a run!
Great idea mate.

+k
Title: Re: BK-SMF Google Translation
Post by: Burke ♞ Knight on December 22, 2008, 10:58:54 PM
As stated above, will not stay in the translated language, when try to log in.
This is due to how Google's translator is coded.
This mod is mainly just to help people read a page in their language.
Great for long topics that guests can see. :)
Title: Re: BK-SMF Google Translation
Post by: Sabre™ on December 22, 2008, 11:05:25 PM
Yes indeed mate.
Im quite fascinated with it.
I really didnt enjoy using babelfish or something when translating a page on someones site, but atleast when they now come to mine, that just need to click the button :D

As stated..  Great idea mate :)

I'd give you another +k, but on my sites you gotta wait 7 hours to give up the next one lol ;)
Who am I to break the rules I expect others to follow!?  lol
Title: Re: BK-SMF Google Translation
Post by: Sudhakar Arjunan on December 25, 2008, 03:08:24 PM
Its an excellent mod.

I am now looking to transfer the codes to match xmas theme by dziner studio.
Title: Re: BK-SMF Google Translation
Post by: averyxie on December 25, 2008, 08:44:30 PM
Great mod, I'm going to give this a run!
Title: Re: BK-SMF Google Translation
Post by: Burke ♞ Knight on December 25, 2008, 08:52:11 PM
Thank you. :)

Just remember, people:

As stated above, will not stay in the translated language, when try to log in.
This is due to how Google's translator is coded.
This mod is mainly just to help people read a page in their language.
Great for long topics that guests can see.
Title: Re: BK-SMF Google Translation
Post by: adp on December 26, 2008, 10:05:21 AM
I love this mod, but, why this not translate to english?
I have a non-english forum :)
Title: Re: BK-SMF Google Translation
Post by: Burke ♞ Knight on December 26, 2008, 10:18:12 AM
Because, Google seems to think that all sites originate in English...LOL :P
Title: Re: BK-SMF Google Translation
Post by: Filipina on December 27, 2008, 05:49:06 PM
I noticed a lot of google translations in tagalog now... is this a recent update which might work in the MOD soon :)
Title: Re: BK-SMF Google Translation
Post by: Burke ♞ Knight on December 27, 2008, 06:15:34 PM
I have not looked into that yet, so do not know.

When I made this mod, I really basically just submitted it, due to the fact that sometimes, people would like to read the info posts of a site in their language, before they decided to join it, so they'd have an idea of what the site was about. I really did not expect it to be so popular, with the limitations of not staying in the translated version if log in.

As for future updates, only the future can tell... :P
Title: Re: BK-SMF Google Translation
Post by: Filipina on December 28, 2008, 10:26:26 AM
Quote from: BurkeKnight on December 27, 2008, 06:15:34 PM
I have not looked into that yet, so do not know.

When I made this mod, I really basically just submitted it, due to the fact that sometimes, people would like to read the info posts of a site in their language, before they decided to join it, so they'd have an idea of what the site was about. I really did not expect it to be so popular, with the limitations of not staying in the translated version if log in.

As for future updates, only the future can tell... :P

To me it would be like a break through... I have so many shy members from the Philippines that never post because they do not completely grasp the English language, but if they could read the posts in Tagalog first it would make a huge difference.  I will hope this can be done for the future :)
Title: Re: BK-SMF Google Translation
Post by: Filipina on December 30, 2008, 12:50:13 PM
Hi!  I was able to get this great MOD installed and use Tagalog as one of the choices yippy!  The only problem is my index.template file is not exactly right and i think the flags are in the wrong place. 

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

Is there anyway you could look at this file and possible help make the flags show up right? It was conflicting with the Google Ads and I cannot get it to be like yours is showing :)

Also are the flags suppose to show up when you log in?

Thanks for any help
Title: Re: BK-SMF Google Translation
Post by: Burke ♞ Knight on December 30, 2008, 01:02:26 PM
Actually, how I see it, it looks neat there. If you could just get them to be centered, I'd leave them there. :)
Title: Re: BK-SMF Google Translation
Post by: Filipina on December 30, 2008, 06:52:14 PM
Actually you are right it is beautiful man!  I centered it.  Wow what an awesome MOD:)  I added Tagalog and Vietnamese.  I just uses this page below to find out what languages could be translated.

http://translate.google.com/

Then I just used your code on the index.template page and like for Tagalog I just changed a couple little letters and same goes for Vietnamese. Then I just added the code in the modifications.english file and boom it's done. Oh, and I made a couple buttons. 

The cool thing is even if people are logged in and they click the flag it only temporarily logs you out... you can at anytime click the "View original web page" in the translation area and you are still logged in and back to English. This MOD has the potential to really grow a community.  Thanks again for the MOD
Title: Re: BK-SMF Google Translation
Post by: 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.

Title: Re: BK-SMF Google Translation
Post by: Mick. on January 22, 2009, 06:12:52 PM
Very cool mod.  Thank you.

www.chevyavalancheclub.com


I also edited the code to only show for guests only.  I applied the code right after the "login" "password" code strings.   Once logged in,you dont see it.

Also i had to replace 1 image and change the size on .css file to make it fit.


Thanx BK!  You rock dude..
Title: Re: BK-SMF Google Translation
Post by: I AM Legend on February 04, 2009, 04:12:41 PM
Hey All,
where do I edit to make it so only guests can see this?
Title: Re: BK-SMF Google Translation
Post by: Burke ♞ Knight on February 04, 2009, 05:23:09 PM
Look two posts above yours. :)

Sabre™ made a nicer post than I would have. :)
Title: Re: BK-SMF Google Translation
Post by: I AM Legend on February 04, 2009, 05:54:54 PM
cool, what php file is that edit in?
Title: Re: BK-SMF Google Translation
Post by: I AM Legend on February 07, 2009, 04:09:30 AM
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.
Title: Re: BK-SMF Google Translation
Post by: Burke ♞ Knight on February 07, 2009, 08:21:46 AM
Index.template.php of the default theme.
Title: Re: BK-SMF Google Translation
Post by: I AM Legend on February 08, 2009, 03:14:06 PM
cool ty
Title: Re: BK-SMF Google Translation
Post by: mockingbird on February 21, 2009, 07:31:37 AM
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.
Title: Re: BK-SMF Google Translation
Post by: mockingbird on February 26, 2009, 11:45:28 AM
bump :(
Title: Re: BK-SMF Google Translation
Post by: mockingbird on March 27, 2009, 01:30:52 PM
super ganz geil total uber toll mega banana bump
Title: Re: BK-SMF Google Translation
Post by: TheListener on May 01, 2009, 09:37:36 PM
the index template failed  :(

How do I install this manually?
Title: Re: BK-SMF Google Translation
Post by: Realinfo on May 14, 2009, 02:01:39 AM
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......................
Title: Re: BK-SMF Google Translation
Post by: Sabre™ on May 14, 2009, 04:46:07 AM
@ 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 :)
Title: Re: BK-SMF Google Translation
Post by: ttuu on May 14, 2009, 07:28:55 AM
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
Title: Re: BK-SMF Google Translation
Post by: TheListener on July 22, 2009, 11:26:27 PM
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?
Title: Re: BK-SMF Google Translation
Post by: Sabre™ on July 22, 2009, 11:46:09 PM
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.
Title: Re: BK-SMF Google Translation
Post by: TheListener on July 28, 2009, 01:27:18 PM
Is there a way to add flags to the mod?

Title: Re: BK-SMF Google Translation
Post by: TheListener on July 30, 2009, 04:00:21 AM
BUMP
Title: Re: BK-SMF Google Translation
Post by: bbmtalk on August 20, 2009, 09:34:14 PM
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?

Title: Re: BK-SMF Google Translation
Post by: wonslung on November 07, 2009, 04:08:21 AM
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?
Title: Re: BK-SMF Google Translation
Post by: scimmiotto on December 04, 2009, 11:44:40 AM
is there any translation of this mod for 20. rc2?
Title: Re: BK-SMF Google Translation
Post by: blokey on December 14, 2009, 02:13:18 PM
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.
Title: Re: BK-SMF Google Translation
Post by: Sabre™ on December 14, 2009, 02:51:18 PM
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%;
}
Title: Re: BK-SMF Google Translation
Post by: blokey on December 14, 2009, 02:59:05 PM
Thanks
Title: Re: BK-SMF Google Translation
Post by: blokey on December 15, 2009, 05:29:25 AM
I moved the flags above the shrink button


any chance you can give me the changes i have 2 do for this

also can i move my search box up there 2
Title: Re: BK-SMF Google Translation
Post by: SteveW on May 04, 2010, 10:09:59 AM
I have added a Welsh to English flag. I had to harcode this in though as it wouldn't convert non-english text as follows:

<a href="http://translate.google.com/translate?hl=en&amp;sl=cy&amp;tl=en&amp;u=', $scripturl, '?topic=', $context['current_topic'], '.0.html" title="Welsh to English" target="_blank"><img src="', $settings['default_theme_url'], '/images/gtflags/wales.png" alt="[WA]" style="border:none;" /></a>

Title: Re: BK-SMF Google Translation
Post by: nend on May 04, 2010, 10:42:36 AM
Well, this is a old mod.

I am still waiting on my mod to be approved which will have language translation with rev17 which is already built but is still in testing. However rev16 is submitted here though and waiting approval.

But here is a real simple language translation to add to your site. Real simple to install, just edit the template or if you have a portal put it in a block. Plus it also works for quest and logged in users.

http://www.google.com/webelements/translate/

Also a live example can be found at http://www.2-si.net/ . Just look at the chat bar at the bottom of the page, it will have language translation.
Title: Re: BK-SMF Google Translation
Post by: lasatalayas on May 14, 2010, 11:17:12 AM
A friend has it on this site and it works perfectly.
I installed it on my site and whenever a button is pressed it goes to a Google Translate page in the new language but at the Forum Login and not with the page translated!
Why?

Ken.
Title: Re: BK-SMF Google Translation
Post by: wakewatcher on August 08, 2010, 04:02:28 PM
I am working on a smf forum site for our Mexico Condo association.  We speak English and Spanish.  Do I understand correctly that this will not allow Spanish to English Translation?  If so any suggestions?
Title: Re: BK-SMF Google Translation
Post by: wakewatcher on August 08, 2010, 04:16:54 PM
Quote from: nend on May 04, 2010, 10:42:36 AM
Real simple to install, just edit the template or if you have a portal put it in a block. Plus it also works for quest and logged in users.

http://www.google.com/webelements/translate/


Could you be more specific on how to install this with smf 2RC3.  I like it that you can translate to English.
Title: Re: BK-SMF Google Translation
Post by: Sabre™ on August 08, 2010, 09:21:19 PM
You could also try [THIS] (http://custom.simplemachines.org/mods/index.php?mod=2386) mod.
It does as you ask.
Title: Re: BK-SMF Google Translation
Post by: wakewatcher on August 09, 2010, 11:31:37 AM
I ended up putting the following just after the global declarations in template_main() in Display.template.php and it seems to work fine.  I only needed Spanish and English.  In order for it to work the way I wanted it I needed to claim that the original language was something other then Spanish or English.

Quote<div id="google_translate_element"></div><script>
function googleTranslateElementInit() {
  new google.translate.TranslateElement({
    pageLanguage: 'af',
    includedLanguages: 'en,es'
  }, 'google_translate_element');
}
</script><script src="http://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
Title: Re: BK-Modding Google Translation
Post by: Burke ♞ Knight on July 01, 2013, 08:43:46 PM
This mod has been updated for SMF 2.0.5 with some changes:

This modification adds Google Translation buttons to the default theme.
There are three different versions:

BK_Modding_Google_Translator_2.0.zip
Places them in the user section, under the Total time logged in line. (1.1.x & 2.0)

BK_Modding_Google_Translator_News_Rep_2.0.zip
Replaces the news box. (2.0 Only)

BK_Modding_Google_Translator_Top_2.0.zip
Replaces the SMF Logo. (2.0 Only)





If need support for this mod, please go to BurkeKnight Enterprises (http://www.burkeknight.com/) and register there.

We have a support ticket system for mod support.

We will no longer be supporting this mod here at the SMF site,
as we feel it is easier to keep all support at our site.