WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: qTranslate] Cannot add/update multilanguage text widget! (12 posts)

  1. minhtam72
    Member
    Posted 1 year ago #

    Hi, I've just updated my site to wordpress 3.5 and managed to make qTranslate work with this new version (followed this link. But today when I try to edit a multilanguage text widget, I discover that the content of the widget keeps unchanged when I click "Save". With the help of Firebug, I can see that content which is posted to admin-ajax.php is the old one, not the newly inputted. So, I guess something might be wrong with the javascript of the plugin. How can I solve the problem?

  2. minhtam72
    Member
    Posted 1 year ago #

    Sorry, I took it wrong, the problem is not with qTranslate but with qTranslate extension. WordPress 3.5 does not use .live('click'... to handle the Save button click event, it use .bind('click.widgets-toggle',... instead, that makes the old function of qTranslate extension processed after the old content has been submitted. Here is my fix:
    Edit qtranslate-extended.php:
    Replace line 202 to 210 with these lines:

    jQuery(document.body).bind('click.widgets-toggle', function(e){
         var target = jQuery(e.target);
         if ( target.hasClass('widget-control-save') ) {
              var form = target.parents('form:first');
              if(form.hasClass('multilanguage-form')){
                   prepareMultilanguageData(form);
                   setTimeout(function(){
                        generateMultilanguageElements(form.parent());
                   },2500);
              }
              e.preventDefault();
         }
    });
  3. anhede
    Member
    Posted 1 year ago #

    Where do I find the file qtranslate-extended.php? I have no such file at all in my directory.

  4. minhtam72
    Member
    Posted 1 year ago #

    Hi anhede, qtranslate-extended.php is included in the plugin "qTranslate extension" , so you won't find it in the folder of "qTranslate".

  5. cbarnett
    Member
    Posted 1 year ago #

    Thank you, that fixed it for me. It was deleting my text fields when I tried to create a new Multilanguage Text Widget (enabled by the qTranslate extension plugin.) You rock, minhtam72!!!

  6. minhtam72
    Member
    Posted 1 year ago #

    Thank you, cbarnett!

  7. xuannguyen
    Member
    Posted 1 year ago #

    Can you detail how to open and change qtranslate-extended.php please!
    I got the same problem when updating to 3.5.
    Thank you so much!

  8. cbarnett
    Member
    Posted 1 year ago #

    To open the qtranslate-extended.php file, go to Plugins in the WordPress dashboard of your website, then navigate to "Editor."

    To the right top side, there should be a drop down list of all the plugins you have installed. Select "qTranslate Extension" and it brings up a list of the php files for the plugin. Open the qtranslate-extended.php file, and in the Editor box, you will see all the code.

    For editing, I copied all of the code (Ctrl+A then Ctrl+C) and pasted it into DreamWeaver in a blank PHP file, to find the correct lines where to insert the fix. (lines 202 to 210) Since I changed my original php file already I'm not sure what the original code was before the replacement.

    After copying in the code pasted above by minhtam72 over these code lines, you can simply copy and paste all of the code from DreamWeaver back in, REPLACING the old code in the Editor code box.

    Click "Save" or "Update Plugin" and you've applied the fix!

  9. xuannguyen
    Member
    Posted 1 year ago #

    Hi cbarnett,
    Thank for your helping!
    I followed your guide, but here are files listed when i select qTranslate plugin
    qtranslate/qtranslate.php
    qtranslate/qtranslate_core.php
    qtranslate/readme.txt
    qtranslate/qtranslate_services.php
    qtranslate/qtranslate_hooks.php
    qtranslate/qtranslate_javascript1.php
    qtranslate/qtranslate_utils.php
    qtranslate/qtranslate_javascript.php
    qtranslate/qtranslate_widget.php
    qtranslate/qtranslate_configuration.php
    qtranslate/license.txt
    qtranslate/qtranslate_wphacks.php

    No qtranslate-extended.php file here!
    Please help me more!
    Thanks so much :)

  10. xuannguyen
    Member
    Posted 1 year ago #

    Oh, I did it!
    I miss in qtranslate plugin and extend.
    I have to install qtranslate extend before.

    Thank you so much!

  11. cbarnett
    Member
    Posted 1 year ago #

    I think your problem is you are selecting the regular qTranslate - This fix is to be applied to a plugin called "qTranslate extension" which is a separate plugin from regular qTranslate here:
    http://wordpress.org/extend/plugins/qtranslate-extended/
    This is the plugin that gives you the Multilanguage Text Widget - qTranslate on it's own does not come with a widget. So if you don't have qTranslate extension installed already, your problem might be something else. This issue is specific to the multilanguage text widget of the qTranslate extension plugin.

    Hope this helps clarify.

  12. badi3
    Member
    Posted 1 year ago #

    Thanks for this! works great

Topic Closed

This topic has been closed to new replies.

About this Topic