WordPress.org

Forums

WP Ajaxify Comments
[resolved] Multilanguage issue (5 posts)

  1. patloq
    Member
    Posted 1 year ago #

    Hi, I really like WP-Ajaxify-Comments. It works very well. I've only a tiny issue. Currently I'm setting up a multilingual site wit WPML. German is set as the main language. The second language is English. When I'm on the English section and I try to post an empty comment WP-Ajaxify-Comments kicks in to displaying its usual message 'Posting your comment. Please wait...' (see screen shot) until it has validated the fields, then stops the posting, and prompts 'FEHLER: Bitte f├╝llen Sie die erforderlichen Felder aus (Name, E-Mail-Adresse).' That's all how it should be apart from the language. For the language part it seems to fall back to the site's primary language as you can see on this screen shot.

    https://wordpress.org/plugins/wp-ajaxify-comments/

  2. janjonas
    Member
    Plugin Author

    Posted 1 year ago #

    Hi patloq,

    I've successfully testes the compatibility of the plugin to WPML, but one has to add a workaround similar to the one described here: http://wpml.org/forums/topic/cant-translate-error-message-of-wp-comments-post-php/.

    Most likely you do not need to add PHP code but can use the options that my plugin provide. For more details, please send me a link to your page because I need to see the "URL structure" of your page.

    Best regards,
    Jan

  3. patloq
    Member
    Posted 1 year ago #

    Hi Jan,

    Yes, it looks like a similar case. In my case however, I use WPML in the mode 'suffix language code' already. Nevertheless, I added the function from WPML link you have posted above. The result: a white screen when posting a comment. Therefore I removed it.

    Here is the link to a post of this site (still in development): http://kadercoach.pp-5.com/proin-ut-ligula-vel-nunc/?lang=en

    Thank you for checking this issue.
    Best,
    Patrick

  4. janjonas
    Member
    Plugin Author

    Posted 1 year ago #

    Please try to set the 'OnBeforeSelectElements' callback option to:

    var form = jQuery(dom).find(WPAC._Options.selectorCommentForm);
    var actionUri = new Uri(form.attr("action"));
    if (!(actionUri.getQueryParamValue("lang"))) {
    	form.attr("action", actionUri.replaceQueryParam("lang", (new Uri(window.location)).getQueryParamValue("lang")).toString());
    }
  5. patloq
    Member
    Posted 1 year ago #

    Thank you, you are legend! Your above code for the OnBeforeSelectElements callback option works perfectly.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP Ajaxify Comments
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.