For further comers,
The whole problem is in the last part of the ppqtranslate_javascript.php
(I think the programmer wanted to test out something and forgot to delete the lines.)
The solution is to carefully select the bad lines (and don’t select anything on the good lines): 417-418 , and delete or comment them out.
Details:
The css and the program itself decides the language by the button’s class name.
As you all know, the classes are separated with a space, but on the 417&418th line, there’s a statement where it messes up that.
document.getElementById('ppqtrans_select_'+ppqtrans_get_active_language()).className+='test';
document.getElementById('ppqtrans_select_'+lang).className+='test';
So what these line are doing is appending “test” to the active button’s class when one of the buttons are pressed.
There is a problem already here because it is appending “test” without a space and it destroys the last class, which is why all the language tabs, including the active one, gets grayed out.
If you move a little bit back and take a look, there is a function that gets the active language. lines 309-320 of “ppqtranslate_javascript.php”:
$q_config['js']['ppqtrans_get_active_language'] = "
ppqtrans_get_active_language = function() {
";
foreach($q_config['enabled_languages'] as $language)
$q_config['js']['ppqtrans_get_active_language'].= "
if(document.getElementById('ppqtrans_select_".$language."').className=='wp-switch-editor switch-tmce switch-html')
return '".$language."';
";
$q_config['js']['ppqtrans_get_active_language'].= "
}
";
It’s hard to read, but you can see on line 315 that it determines the language by its class name, and it has to be EXACTLY the same.. (Oops)
Plus, there is no default “return” sentence, so if it can’t find the active language, it won’t return anything. (that’s why the error ‘null is not an object’ comes up)
Thus the solution would be pretty simple, fix the program, so it won’t mess it self up by putting an extra class “test”.