WordPress.org

Ready to get started?Download WordPress

Forums

Disqus Comment System
[resolved] Language filter is not working (4 posts)

  1. cybnet
    Member
    Posted 4 months ago #

    Hi!!

    I'm having problems with disqus in a multi-lingual site. I'm using this code to override the configuration of Disqus global language:

    add_filter('disqus_language_filter','isp_disqus_language_filter');
    function isp_disqus_language_filter() {
      return qtrans_getLanguage();
    }

    The site is in Russian and Spanish. The global language in Disqus settings is set to Russian. When I see my site in Russian, Disqus is loaded correctly in russian but in spanish pages Disqus is loaded in English. In Spanish pages I can this javascript (which I think is correct but is not working):

    var disqus_config = function () {
    var config = this; // Access to the config object
    config.language = 'es';

    http://wordpress.org/plugins/disqus-comment-system/

  2. Mouseviator
    Member
    Posted 4 months ago #

    Hi,

    try to manually reinstall the plugin. Maybe not all files are updated correctly.

    I had similar issue - I set disquis language via JavaScript but the language was still English no matter what.

    First,I found out, that the JavaScript inserted by wordpress plugin is using isset function to find out if disqus_language variable is set and therefore set the preferred language. The problem here was, that isset is not JavaScript function, so the condition to set the language was never executed.

    But that JavaScript code is no longer present in version 2.74. Second issue here. I updated the plugin to version 2.74 via wordpress, but even though it was convincing me the update was successful, the source files was not updated (or just some of them).

    So I downloaded the latest version manually, deleted the old plugin and uploaded the latest one and it works with code you wrote (thanks for that btw).

  3. cybnet
    Member
    Posted 4 months ago #

    Thanks for the suggestion but an incorrect update is not the problem here as I installes 2.74 version as the first version of disqus plugin used on the site.

    Also, I have problems when the language settings via javascript is different from the language setting via disqus admin area. I mean, I have set language to russian (disqus admin settings) and disqus in loaded in russian corretly (both if "ru" or "" is set via javascript) but disqus is loaded in english if a different language is set via javascript (not always as happend to you).

    For example, I've tried:

    //Disqus is loaded in english
    add_filter('disqus_language_filter','isp_disqus_language_filter');
    function isp_disqus_language_filter() {
      return "es";
    }
    
    //Disqus is loaded in russian, same as the disqus global settings
    add_filter('disqus_language_filter','isp_disqus_language_filter');
    function isp_disqus_language_filter() {
      return "ru";
    }
    
    //Disqus is loaded in russian, same as the disqus global settings
    add_filter('disqus_language_filter','isp_disqus_language_filter');
    function isp_disqus_language_filter() {
      return "";
    }
  4. cybnet
    Member
    Posted 4 months ago #

    I've contacted with Disqus support service and the problem is that the language code "es" is not fully translate, so I saw english strings. I'm now using "es_ES" as language code and it works as expected.

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.