Question

I want to have a different disqus thread for each language variation of the same page.

I have on my sites different versions of the same article, lets say :

French version  : http://www.example.com/fr/article/38/soe-friendly-title-in-french
English version : http://www.example.com/en/article/38/soe-friendly-title-in-english

Same article, different language, different url.

In that page, I have a disqus plugin set up using these parameters. The parameters are generated server side (asp.net mvc 4) :

<script type="text/javascript">
    var disqus_config = function () {
        this.language = '@i18n.Resources.Param_Lang'; // "fr" or "en";
    }

    var disqus_identifier = '@disqusIdentifier' //"article_38_fr" or "article_38_en"
    var disqus_title = '@localizedTitle' //title localized in french or english
    var disqus_url = '@articleUrl' //article full url
    var disqus_shortname = 'mydisqusshortname';

    (function() {
        var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
        dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
        (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
    })();
</script>

I thought this would allow me to separate english comments from french comments on the same article. But the this is Disqus doesn't seem to care much about those parameters, and the french version of the article's comments appear on the english version of the article. However, the Disqus UI is correctly localized (Disqus is in french on the french page and in english on the english page).

Is there a parameter that I'm missing ? Are the url's too similar to be distinguished as two separate topics ?

Was it helpful?

Solution

I will answer my own question, my unique identifier wasnt "unique" enough.

So I added a hash to my identifiers and my topics are now separated as expected. See Disqus Loading the same comments for dynamic pages for reference.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top