I will try fraig's hack a bit later and see how it works with the extension being used. First I have to deal with other things, e.g. I have a big "backlog" of content to work through.weltonwms wrote: ↑Thu Dec 02, 2021 1:05 amfraig showed the exact point of conflict. I will try to explain what I think happened. Mootools changes the Array.from() function. This function is native to javascript array. mootools in version 1.4.5 does not take into account receiving an object in this function. Possibly before the Google API didn't use Array.from() passing an object and recently started to use it. I think it's hard for someone to do what Mootools did, which is to overwrite something native to Javascript, but the fraig hack is perfect precisely because of that. The hack leaves the mootools code as it is, but when it comes to object conditions, it uses the native Array.from(), javascript's native function.
sokrates_mx5 can trust the fraig hack, as it doesn't change almost anything, it just adds the correct use of Array.from() which is native to javascript.
GTranslate plugin don't translate recently. Topic is solved
Moderators: pe7er, General Support Moderators
Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
-
- Joomla! Explorer
- Posts: 310
- Joined: Tue Mar 24, 2009 12:30 pm
Re: GTranslate plugin don't translate recently.
Thanks, I do apreciate all your explanations.
-
- Joomla! Apprentice
- Posts: 7
- Joined: Sun Mar 05, 2017 3:51 pm
Re: GTranslate plugin don't translate recently.
If you don't want to face the code, please find attached mootools-core.js with the fraig hack. Just replace that file. You can test it's success. The only modification is:
download/file.php?mode=view&id=131917
Code: Select all
old_array_from = Array.from; //this old_array_from is the native Array.from of javascript
//....
:("object" == b(a))
?old_array_from(a) // use of javascript's native Array.from for type "object"
//...
You do not have the required permissions to view the files attached to this post.
-
- Joomla! Explorer
- Posts: 310
- Joined: Tue Mar 24, 2009 12:30 pm
Re: GTranslate plugin don't translate recently.
Thanks for the file. I don't have a problem changing things in the code, but now you made it even easier for me and others when we just need to upload the fileweltonwms wrote: ↑Thu Dec 02, 2021 1:31 pmIf you don't want to face the code, please find attached mootools-core.js with the fraig hack. Just replace that file.
download/file.php?mode=view&id=131917
mootools-core.js
I will test it later on.
-
- Joomla! Fledgling
- Posts: 1
- Joined: Fri Sep 06, 2013 8:18 pm
Re: GTranslate plugin don't translate recently.
I updated the mootools-core.js file on my website with the latest version from mootools.net/core and Gtranslate is now working.
-
- Joomla! Fledgling
- Posts: 1
- Joined: Sun Mar 11, 2012 12:24 am
Re: GTranslate plugin don't translate recently.
Hello,fraig wrote: ↑Wed Dec 01, 2021 1:55 pmHi,
a few days ago, I noticed that GTranslte plugin no longer worked properly and the only error was a console message that said something like "Resource blocked due to MIME type mismatch (X-Content-Type-Options: nosniff)".
I found that this problem was caused by Array.from javascript function rewrite by /media/system/js/mootools-core.js library:
[cut]
I tried the change and it works.
I am using Joomla! 3.10.3 and Gtranslate 3.7.6
Tanks
Last edited by toivo on Fri Dec 03, 2021 8:36 pm, edited 1 time in total.
Reason: mod note: missing /quote
Reason: mod note: missing /quote
-
- Joomla! Explorer
- Posts: 310
- Joined: Tue Mar 24, 2009 12:30 pm
Re: GTranslate plugin don't translate recently.
I've been using fraig's hack for some time now and so far so good
-
- Joomla! Explorer
- Posts: 310
- Joined: Tue Mar 24, 2009 12:30 pm
Re: GTranslate plugin don't translate recently.
Back to square one after upgrading Joomla to 3.10.4
GTranslate stopped working after upgrading Joomla from 3.10.3 to 3.10.4.
Uploaded the file with the hack again and cleared the cache of the browser, and now GTranslate works again
GTranslate stopped working after upgrading Joomla from 3.10.3 to 3.10.4.
Uploaded the file with the hack again and cleared the cache of the browser, and now GTranslate works again
-
- Joomla! Fledgling
- Posts: 1
- Joined: Wed Dec 06, 2017 2:38 am
Re: GTranslate plugin don't translate recently.
Great hack thanks for the help... Just find /media/system/js/mootools-core.js and change it out with the hack. Awesome!!!
-
- Joomla! Fledgling
- Posts: 1
- Joined: Thu Aug 30, 2018 5:16 pm
Re: GTranslate plugin don't translate recently.
You are a Master!!! It soved the issue and now Gtranslate works great; Thanks!
fraig wrote: ↑Wed Dec 01, 2021 1:55 pmHi,
a few days ago, I noticed that GTranslte plugin no longer worked properly and the only error was a console message that said something like "Resource blocked due to MIME type mismatch (X-Content-Type-Options: nosniff)".
I found that this problem was caused by Array.from javascript function rewrite by /media/system/js/mootools-core.js library:
I think the best solution is to disable MooTools javascript library, if possible. In my case other parts depend on it, so I solved the problem by changing the Array.from function as follows:Code: Select all
Array.from = function(a) { return null == a ? [] : f.isEnumerable(a) && "string" != typeof a ? "array" == b(a) ? a : e.call(a) : [a] }
In my case the translation started working again. I hope this solution can be useful.Code: Select all
// Old code // Array.from=function(a){return null== // a?[]:f.isEnumerable(a)&&"string"!=typeof a?"array"==b(a)?a:e.call(a):[a]}; // New code old_array_from = Array.from; Array.from=function(a){ return null==a ?[] :f.isEnumerable(a)&&"string"!=typeof a ?"array"==b(a) ?a :e.call(a) :("object" == b(a)) ?old_array_from(a) :[a]; };
I'm using Joomla! 3.4.6 and GTranslate 3.7.6.
-
- Joomla! Fledgling
- Posts: 1
- Joined: Fri Jan 07, 2022 4:42 pm
Re: GTranslate plugin don't translate recently.
Great solution, it's a machine. Thank you very much it worked for 3.10.4 and Gtranslate 3.7.6, but when updating joomla it stops working. I tried with the same solution, but it doesn't work, does it work for anyone?weltonwms wrote: ↑Thu Dec 02, 2021 1:31 pmIf you don't want to face the code, please find attached mootools-core.js with the fraig hack. Just replace that file. You can test it's success. The only modification is:
download/file.php?mode=view&id=131917Code: Select all
old_array_from = Array.from; //this old_array_from is the native Array.from of javascript //.... :("object" == b(a)) ?old_array_from(a) // use of javascript's native Array.from for type "object" //...
mootools-core.js
Can you help me for version 3.10.9?
-
- Joomla! Fledgling
- Posts: 3
- Joined: Sun Jul 03, 2022 4:06 pm
Re: GTranslate plugin don't translate recently.
Thank you sooooo much! It works perfect with my plugin RokSprocket and GTranslate, Joomla 3.10.
Before it was not translating any pages with RokSprocket modules, now it does.
Great job!!!
Before it was not translating any pages with RokSprocket modules, now it does.
Great job!!!
weltonwms wrote: ↑Thu Dec 02, 2021 1:31 pmIf you don't want to face the code, please find attached mootools-core.js with the fraig hack. Just replace that file. You can test it's success. The only modification is:
download/file.php?mode=view&id=131917Code: Select all
old_array_from = Array.from; //this old_array_from is the native Array.from of javascript //.... :("object" == b(a)) ?old_array_from(a) // use of javascript's native Array.from for type "object" //...
mootools-core.js
-
- Joomla! Apprentice
- Posts: 21
- Joined: Sat Aug 03, 2013 6:50 am
- Location: Philippines
Re: GTranslate plugin don't translate recently.
Hello
Thanks for introducing the GTranslate plugin, does Joomla's GTranslate use the power of Google Translate?
If there is more guidance, please explain.
Thank You
Thanks for introducing the GTranslate plugin, does Joomla's GTranslate use the power of Google Translate?
If there is more guidance, please explain.
Thank You
-
- Joomla! Fledgling
- Posts: 2
- Joined: Mon Oct 10, 2022 6:31 pm
Re: GTranslate plugin don't translate recently.
hello
what application can you recommend to replace gtranslate "?
thanks
what application can you recommend to replace gtranslate "?
thanks
-
- Joomla! Fledgling
- Posts: 2
- Joined: Mon Oct 10, 2022 6:31 pm
Re: GTranslate plugin don't translate recently.
hello,
I have a problem. I use Joomla! 3.10.11 and gtranslate as well as the google translate widget application do not work on the site. if I delete mootools-core.js then it works but instead only another function from the site works for me which I also use and it is more important than translate.
I also uploaded mootools-core.js modified by the colleague above, but that doesn't work either.
thanks
I have a problem. I use Joomla! 3.10.11 and gtranslate as well as the google translate widget application do not work on the site. if I delete mootools-core.js then it works but instead only another function from the site works for me which I also use and it is more important than translate.
I also uploaded mootools-core.js modified by the colleague above, but that doesn't work either.
thanks