Advertisement:

Author Topic: Google Translate for SMF 2.0  (Read 63047 times)

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 59,816
  • Gender: Male
    • Kindred-999 on GitHub
Re: Google Translate for SMF 2.0
« Reply #100 on: January 20, 2016, 09:42:46 PM »
well, if you have tracked it that far -- then yes...   however, none of the stuff that Siirist was trying to do (and breaking things while doing) would have any effect on the root issue.

1- IS a value entered for the ID in the configuration
  -- if no, then enter something
  -- if yes, and this error still occurs, then the variable is not getting properly written into (or maybe read out of) the context array

2- check the variable/index name in the code where the mod settings are getting set...
  -- is the SAME variable/index name being written into $context which this code is trying to read out?
     -- if no, then that is the problem. Match/sync the variable/index names
     -- if yes, then the issue occurs after the variable/index is written INTO the array (and it looks like the array loses the variable/index

3- further analysis is needed
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Offline Siirist

  • Sophist Member
  • *****
  • Posts: 1,201
  • Gender: Male
  • What would Kindred or Illori do?
    • A Sanctuary (Support for Survivors of abuse/Info for Family & Friends)
Re: Google Translate for SMF 2.0
« Reply #101 on: January 20, 2016, 10:32:51 PM »
Hey Kindred,

I apologize for all the heartache.

As pointed out earlier, I am using SMF ver 2.0.11 and Ostara1 is the forum's default theme.

Okay, so I went to uninstall and got Failures with the Ostara1 theme.
I did NOT uninstall, instead I went to the theme and parsed it for ver. 2.0.11

The code that it called for to be installed in the themes/default/index.template.php
I removed from themes/ostara1/index.template.php
I removed 6200 errors from the log.
I refreshed the page and NO ERRORS!!!   ;D

APPARENTLY this MOD is NOT COMPATIBLE with OSTARA1.

I have reset the forum's default theme to Fresh Leaf.

Thank you for all your thoughts on this.

Be Well,
Siirist
Needed information:
- What's your SMF version?, What MODs are installed? What Theme(s) are you using? Have you backed up your database?

--> At least 50% of the questions asked are answered in the Online Manual <--
Mods for ver 1.x will NOT run on ver 2.x

Offline Jade Elizabeth

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 12,701
  • Gender: Female
  • Keep your enemies close and your friends closer ;)
    • jadetrainor on LinkedIn
    • @alundra on Twitter
    • Jades-World
Re: Google Translate for SMF 2.0
« Reply #102 on: January 21, 2016, 01:05:12 PM »
APPARENTLY this MOD is NOT COMPATIBLE with OSTARA1.

Those errors weren't actual errors, they weren't breaking things they were more annoying warnings that the code couldn't find a value. It doesn't matter what theme you use for the mod you will get the error.

well, if you have tracked it that far -- then yes...   however, none of the stuff that Siirist was trying to do (and breaking things while doing) would have any effect on the root issue.

1- IS a value entered for the ID in the configuration
  -- if no, then enter something
  -- if yes, and this error still occurs, then the variable is not getting properly written into (or maybe read out of) the context array

2- check the variable/index name in the code where the mod settings are getting set...
  -- is the SAME variable/index name being written into $context which this code is trying to read out?
     -- if no, then that is the problem. Match/sync the variable/index names
     -- if yes, then the issue occurs after the variable/index is written INTO the array (and it looks like the array loses the variable/index

3- further analysis is needed


Yep, it's failing to get a variable when there is one and to recognise it shouldn't be getting one when it's set not to.
Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.

Offline TKW

  • Newbie
  • *
  • Posts: 7
  • Gender: Male
Re: Google Translate for SMF 2.0
« Reply #103 on: February 20, 2016, 03:21:24 AM »
You can fix it by editing index.template.php
Find:
Code: [Select]
// Google Translate Mod
echo'
<br />
<div align="right"><div id="google_translate_element"></div><script>
function googleTranslateElementInit() {
  new google.translate.TranslateElement({
    pageLanguage: \'auto\',
    layout: google.translate.TranslateElement.InlineLayout.HORIZONTAL
  }, \'google_translate_element\');
}</script><script src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script></div>';

Change the following:
    pageLanguage: \'auto\',

with one of the following language codes to your forum language:
Eg:
English forum = en

af = AFRIKAANS
sq = ALBANIAN
ar = ARABIC
be = BELARUSIAN
bg = BULGARIAN
ca = CATALAN
zh-CN = CHINESE_SIMPLIFIED
zh-TW = CHINESE_TRADITIONAL
hr = CROATIAN
cs = CZECH
da = DANISH
nl = DUTCH
en = ENGLISH
eo = ESPERANTO
et = ESTONIAN
tl = FILIPINO
fi = FINNISH
fr = FRENCH
de = GERMAN
el = GREEK
ht = HAITIAN_CREOLE
iw = HEBREW
hi = HINDI
hu = HUNGARIAN
is = ICELANDIC
id = INDONESIAN
ga = IRISH
it = ITALIAN
vc = JAPANESE
ko = KOREAN
lv = LATVIAN
lt = LITHUANIAN
mk = MACEDONIAN
ms = MALAY
mt = MALTESE
no = NORWEGIAN
fa = PERSIAN
pl = POLISH
pt = PORTUGUESE
pt-br = PORTUGUESE_BRAZ
ro = ROMANIAN
ru = RUSSIAN
sr = SERBIAN
sk = SLOVAK
sl = SLOVENIAN
es = SPANISH
sw = SWAHILI
sv = SWEDISH
th = THAI
tr = TURKISH
uk = UKRAINIAN
vi = VIETNAMESE
cy = WELSH
yi = YIDDISH

I am working on a Admin settings page but atm it's not going too good.

I don't have this code.  I'm trying to edit what languages are in the list, and what order they are listed.  is this possible?

Offline badon

  • Jr. Member
  • **
  • Posts: 185
Re: Google Translate for SMF 2.0
« Reply #104 on: August 10, 2016, 01:29:27 AM »
For some reason all the settings for this mod are appearing screwed-up, after years of working perfectly. The form fields aren't displaying properly. Any ideas what's going on?

Offline landyvlad

  • Sr. Member
  • ****
  • Posts: 943
  • Gender: Male
    • Michael Reed on Facebook
    • GSX1400 Owners ORG
Re: Google Translate for SMF 2.0
« Reply #105 on: February 02, 2017, 07:06:03 AM »
Before I attempt to install this - does anyone know if it's working now?
Please do not PM, IM or Email me with questions on astrophysics or theology.  You will get better and faster responses by asking homeless people in the street. Thank you.

To paraphrase Kindred: "There are no technical solutions to social problems."

No hack nor blackhats, just persistent asshats.

Offline badon

  • Jr. Member
  • **
  • Posts: 185
Re: Google Translate for SMF 2.0
« Reply #106 on: February 03, 2017, 02:45:41 AM »
It has been a while since I've tinkered with it, but at the last SMF 2.0.13 update, it still had UI problems.

Offline landyvlad

  • Sr. Member
  • ****
  • Posts: 943
  • Gender: Male
    • Michael Reed on Facebook
    • GSX1400 Owners ORG
Re: Google Translate for SMF 2.0
« Reply #107 on: February 03, 2017, 08:34:02 AM »
bugger...
Please do not PM, IM or Email me with questions on astrophysics or theology.  You will get better and faster responses by asking homeless people in the street. Thank you.

To paraphrase Kindred: "There are no technical solutions to social problems."

No hack nor blackhats, just persistent asshats.

Offline landyvlad

  • Sr. Member
  • ****
  • Posts: 943
  • Gender: Male
    • Michael Reed on Facebook
    • GSX1400 Owners ORG
Re: Google Translate for SMF 2.0
« Reply #108 on: February 05, 2017, 07:30:38 AM »
Out of interest... I don't think the mod author has logged in here for 12 months.... has someone else got carriage of this mod or is it kinda "dead in the water"?
Please do not PM, IM or Email me with questions on astrophysics or theology.  You will get better and faster responses by asking homeless people in the street. Thank you.

To paraphrase Kindred: "There are no technical solutions to social problems."

No hack nor blackhats, just persistent asshats.

Offline bravoure

  • Newbie
  • *
  • Posts: 3
Re: Google Translate for SMF 2.0
« Reply #109 on: April 09, 2017, 04:02:20 PM »
why would you have done any of that other stuff?   You don't change CODE for this...  the probloem is in the CONFIGURATION... it just happens to be showing up when the setting is called.

No actually the problem is the code. The setting on mine says not to use the analytics id, it's set to false, but false is ignored in the code and it tries to call an id that's not entered, and we get this error. The setting on Siirist's says to use the analytics id, which has been entered, and it is not being put in there either. Somewhere, the ball is being dropped on this variable.



Siirist: Disabling template eval won't solve the issue, it will just make SMF show you the exact location of errors. With it enabled like you had before no one can really help you fix any errors because SMF can't tell anyone where they are exactly :).

change into index.template.php

Code: [Select]
gaId: \'' . $modSettings['google_translate_analytics_id'] . '\',
to

Code: [Select]
gaId: \'' . (isset($modSettings['google_translate_analytics_id'])?$modSettings['google_translate_analytics_id']:'') . '\',

Offline Secureas

  • Semi-Newbie
  • *
  • Posts: 14
Re: Google Translate for SMF 2.0
« Reply #110 on: August 25, 2018, 09:36:06 PM »
Hello I am using this mod and it appears everywhere and works, the only problem I have found is that it does not appear on a post in the forum?

Offline jsx

  • Full Member
  • ***
  • Posts: 495
  • Gender: Male
Re: Google Translate for SMF 2.0
« Reply #111 on: December 17, 2020, 01:03:50 PM »
I wonder if it is possible to prevent the translation of usernames by the Google Translate. Does anyone know if it can be changed?
The Great Winged Hussars

https://www.youtube.com/watch?v=eWkrQQly6xU

We remember
In september
When The Winged Hussars arrived!