I’d guess it is some kind of jQuery conflict, but I need a site to see the problem directly.
Hi Ofer,
Sorry for the late reply.
You can see the issue happening here: http://www.akademeia.org
The Transposh widget is at the bottom. If you change from English to Portuguese and try setting it as default, you should see the error I’m getting.
Thank you time and for looking at it 🙂
Hello Otto,
Since transposh.js is not being included at all, this can’t work 🙂
This is an omission on my side, you can fix it by either including the function yourself, or enabling auto-translate…
I will add this to the todo
Try changing line 716 of transposh.php to:
if (!($this->edit_mode || $this->is_auto_translate_permitted() || is_admin() || $this->options->get_widget_allow_set_default_language()))
Thanks for the reply Ofer 🙂
Changed the line as you said, that makes it work when translation editing is turned on but not when it is turned off. Which means that I can set portuguese as my account default if I activate editing but I can’t set back to english as the default as it is not editable xD
PS: I don’t know php but If I understand the line correctly, it only work for admins?
Please try commenting out lines 716, 717
This line means it should work when in edit mode, or when auto translation is permitted, or an admin is logged on (and I have tried adding the fact that a language is settable by user).
Let me know if that helps
Commenting out lines 716 and 717 has the same result as the first modification. In other words: nothing happens unless I’m editing the language, then I can set my default (but can’t set back due to english being the site’s default).
Oopps
I missed lines 769 and 771, please try to comment them both out
I also suggest returning 716 to what I suggested previously and uncommenting 717
Sorry about the mess 🙂
You call it a mess, I call it a process xD
Really appreciatte your help mate 🙂
That works for the ajax, now clicking set default gives the expected result. Only odd thing left is that if I close the page and open it back, it goes back to English, no matter which language I set as my default.
Any clue on this one?
🙂
Guess I need to explain this, the session is still alive meaning it will not redirect, otherwise you could have never switch to another language again.
What you should try, close the browser (not just the tab) and then check what happens.
I guess this behaviour is not the most trivial, but other behaviours might cause deadlocks in returning to the original language.
You can probably change the code to force it, but I don’t recommend this
Have fun,
Hmm, ok, I think I understand it now. Tested like you said and indeed, the user default is preserved whenever I close the tab and then close the browser but not if I close the tab and open it anew.
Would be nice if it saved for logged in users but I understand what you mean with the deadlocks and I as well would rather be safe than sorry. 🙂
Thank you very much for all the help Ofer, great support, great plugin 🙂
Marking this as solved.