News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Google Translator Flags Mod

Started by roco, March 04, 2010, 10:50:16 PM

Previous topic - Next topic

meteo021

Yes, I'm using SMF 1.1.11, I forgot to mention that, sorry
Automatic installation didn't succeed so I try manually. I made gtflags  directory (with images of flags inside) in web/smf_forum/themes/default/images
and than I change Display.template.php like this:

<td width="13%"> ', $txt[29], '</td>
            
            <td valign="middle" width="85%" style="padding-left: 6px;" id="top_subject">
            <!-- Google Translator Flags by Roco -->
               <div style="float:right; margin:2px 1px; display:inline; vertical-align:middle; zoom:1;" charset="utf-8">
                  <a href="hxxp:translate.google.com/translate?hl=en&amp;sl=' [nonactive];, $txt['lang_dictionary'], '&amp;tl=en&amp;u=', $scripturl, '?topic=', $context['current_topic'], '.0.html" title="Translate into English [EN]" target="_blank"><img src="', $settings['default_theme_url'], '/images/gtflags/us.png" alt="[EN]" style="border:none;" /></a>
                  <a href="hxxp:translate.google.com/translate?hl=en&amp;sl=' [nonactive];, $txt['lang_dictionary'], '&amp;tl=es&amp;u=', $scripturl, '?topic=', $context['current_topic'], '.0.html" title="Traducción al espanol [ES]" target="_blank"><img src="', $settings['default_theme_url'], '/images/gtflags/es.png" alt="[ES]" style="border:none;" /></a>
                  <a href="hxxp:translate.google.com/translate?hl=en&amp;sl=' [nonactive];, $txt['lang_dictionary'], '&amp;tl=it&amp;u=', $scripturl, '?topic=', $context['current_topic'], '.0.html" title="Tradurre in italiano [IT]" target="_blank"><img src="', $settings['default_theme_url'], '/images/gtflags/it.png" alt="[IT]" style="border:none;" /></a>
                  <a href="hxxp:translate.google.com/translate?hl=en&amp;sl=' [nonactive];, $txt['lang_dictionary'], '&amp;tl=de&amp;u=', $scripturl, '?topic=', $context['current_topic'], '.0.html" title="Ins Deutsche übersetzen [DE]" target="_blank"><img src="', $settings['default_theme_url'], '/images/gtflags/de.png" alt="[DE]" style="border:none;" /></a>
                  <a href="hxxp:translate.google.com/translate?hl=en&amp;sl=' [nonactive];, $txt['lang_dictionary'], '&amp;tl=fr&amp;u=', $scripturl, '?topic=', $context['current_topic'], '.0.html" title="Traduire en français [FR]" target="_blank"><img src="', $settings['default_theme_url'], '/images/gtflags/fr.png" alt="[FR]" style="border:none;" /></a>
                  <a href="hxxp:translate.google.com/translate?hl=en&amp;sl=' [nonactive];, $txt['lang_dictionary'], '&amp;tl=ru&amp;u=', $scripturl, '?topic=', $context['current_topic'], '.0.html" title="ruski [RU]" target="_blank"><img src="', $settings['default_theme_url'], '/images/gtflags/ru.png" alt="[RU]" style="border:none;" /></a>
               </div>
                <!-- End of Google Translator Flags by Roco -->
                  ', $txt[118], ': ', $context['subject'], ' &nbsp;(', $txt[641], ' ', $context['num_views'], ' ', $txt[642], ')
            </td>
      </tr>';
   if (!empty($settings['display_who_viewing']))

So I did put your modification inside td tag like you sad but it still doesn't work.
What I did wrong now?
Thank you for your previous fast reply.

meteo021

Now I see these "nonactive' notifications for the links to google translator. Why is that?

meteo021

Well, this is how things are at the moment:
I have translator flags on the topics, but I do not have them at home page and at forum pages.

lasatalayas

#23
Today my friend installed it on his site and it works perfectly-
I installed it on my site which is similar and I have a small problem.
When a flag is clicked the Google Translate page opens in the new language but at the Login Page not at the topic page page.
Can you help?

Ken.


OK - solved
Allow guests to browse the forum

Miasma

Quote from: roco on April 13, 2010, 08:47:14 PM

QuoteAnyway, nice mod.

Thank You :)

btw I wanted to create something simple that does not interfere too much in the mechanisms of the SMF and its DB...
I know what You mean. I think is posible integration of Google Translate API in to SMF like VB.
I reflected on this path, but I chose a simpler solution, because I respect people's privacy,
and this can not be ensured by using the Google API
I promise that I think about this in the near future, ok? ;)


Yours :)
roco

.

Thanks ^^


wakewatcher

I installed this but when I click on the flag to translate it opens a new browser window and doesn't display the topic but translates and presents a new login page.
smf 2.0.18

yakyakyak

In RC3 is there anything in Admin Panel  :-\

willerby

Awesome MOD roco - manual install on RC4 to tailor the languages I wanted and works a dream

Thank you
What type of washing machine is September?

An autumnatic. :)

Storman™

If it helps anyone then I can advise that this mod works fine in 2.0 Gold.

It doesn't install into the Core theme though. That theme requires a manual install and an amendment of line 166. Otherwise all works good.

Tried it on several themes now with no probs.  ;)

sudoku

Has anyone tried to use, or is using this in SMF version 2.1.4???

Diego Andrés

Probably not, seems very outdated.
In addition, browsers now have plugins (even built in natively), to translate the content of websites so this might not be a very useful mod.

SMF Tricks - Free & Premium Responsive Themes for SMF.

sudoku

Thanks Diego, yes, it was kind of a 'long shot', seeing the age of the thread.
But we didn't know for sure, until we asked.  :)

Advertisement: