Is there anyway to set the language of disqus form on the drupal site instead of disqus site. Like this it could be dynamically switched to any language on a multilang website.
| Comment | File | Size | Author |
|---|---|---|---|
| #13 | 1054604-disqus-proper-locale-support-13.patch | 2.97 KB | barraponto |
| #12 | 1054604-disqus-proper-locale-support-12.patch | 2.97 KB | barraponto |
| #4 | disqus_localization.patch | 3.1 KB | robloach |
| #3 | disqus_localization.patch | 3.3 KB | robloach |
Comments
Comment #1
heyyo commentedfound this link on disqus developper which provides this new functionnality:
http://groups.google.com/group/disqus-dev/browse_thread/thread/ed6cd66c3...
Comment #2
rnyberg commentedI am attempting to get our site work with that language modifier as well. Any info you have on it appreciated!
Comment #3
robloachHere it is for Drupal 7... Once in we could port it to Drupal 6! Thanks for the help on this, rnyberg.
Comment #4
robloachWhoops, don't want debugging info in there.
Comment #5
robloachThanks!!!! Uses the $language->language variable, so it's based on the content that's being used. It's a toggle in the Disqus administration in case you'd rather just use the one provided by Disqus.
Drupal 6: http://drupal.org/cvs?commit=497528
Drupal 7: http://drupal.org/cvs?commit=497510
Comment #7
emattias commentedUnfortunately disqus doesn't always use the same language codes as Drupal does. For example the language code for swedish in drupal is "sv" and in Disqus it's "sv_SE". So if I enable localization support on my multi lang (en/sv) site disqus won't work at allon teh swedish part of the site since it sends the language "sv" to disqus which it doesn't know.
My 2 proposed solutions are:
1. "Translate" the language code from Drupal lang codes to Disqus lang codes before sending it to disqus, which makes it transparently just work. Porhaps this could be done when saving the disqus settings form and/or language settings form and save it to a variable?
OR
2. List the enabled languages on the site in the disqus settings form and let the admin match it to a disqus language code.
For my site I overrided the Drupal.behaviors.disqus in js and changed the line:
to
I found the lang codes by inspecting the language select box on the general settings page on disqus.com. Heres that source code(note the value attribute on the option tags):
Comment #8
SilviaT commentedsub
Comment #9
igalarza commentedHello, I've just configured and enabled Disqus in my multilingual web site, following the instructions in #7 and is working fine. This is the code that I've added:
I've not created a patch because my code is incomplete and maybe incorrect, but I hope you find it useful.
Kind regards.
Comment #10
barrapontoThe code in the last patch have been committed for a year now. Yet there is still a bug in that Disqus localization doesn't follow any ISO recommendation. Drupal follows ISO 3166-1 alpha 2, see includes/iso.inc.
The best case solution would be for Disqus to move to any ISO standard so we can just map the values. Since we shouldn't rely on that, I guess the best way to move forward now would be to implement the mapping manually, as a fallback.
Comment #11
barrapontoEDIT: the ISO standard followed by Drupal is ISO 639-1.
ISO 3166-1 is also followed, but for country codes.
Comment #12
barrapontoAttached is a patch that checks the Disqus language support and uses the proper Disqus code.
Comment #13
barrapontoRe-rolling to strip trailing whitespace from patch.
Comment #14
alexweber commentedTested and works for me!
Thanks barraponto for this patch.
Comment #15
barrapontoIt actually breaks the module for some languages.
Is this critical material?
Comment #16
Cyclodex commentedPatch looks good but it is not working for me, I debugged until config var and there it is set the correct language now.
(I need German translation and de_formal should be supported on disqus...)
Question: Do you have enabled the setting "2012 Feature" on Disqus.com ?
I will have to check if the API changed, its just not working over here :(
Comment #17
barrapontoGotta test whether it's still needed with latest disqus. I've been using this patch with disqus 2012, no issues.
Comment #18
Cyclodex commentedDo you have different languages on you site ?
Or are you just using the default language which can be selected over at disqus.com ?
Comment #19
Cyclodex commentedOkey, it is the Feature 2012!
Disable it on the disqus.com account/settings and it will work.
Seems they have to implement language support in 2012 Version or something is wrongly documented.
It does not work for me.
Comment #20
robloachLooks pretty good to me, is there anything holding this back from being committed?
Comment #21
Cyclodex commentedYou mean the patch looks fine yea? What about the Feature 2012? That is also not working for you, is it ? You also have to disable the Feature 2012 , correct ?
Comment #22
barrapontoI've tested it thoroughly. "Localization Support" is ignored if Disqus 2012 features are enabled for your site.
Comment #23
barrapontoI guess it's an upstream issue. I've pinged disqus support on this, awaiting responses.
Comment #24
Cyclodex commentedI made a comment on a page, after someone else also commented it is not working, but now I can not find them anymore. Not sure if they removed them now.... :-/
Comment #25
barraponto@Cyclodex is your bug related to locale issues? If it's unrelated, please open a new issue. And if you think it's an issue with the Disqus service (not the Drupal module), post it to their support forum: http://disqus.com/support .
Comment #26
Cyclodex commentedAlright, but I am not sure if
A: the Drupal module is not compatible with their Feature 2012 enabled settings.
or
B: They have an issue in general on the Feature 2012 Service regarding language.
Anyway is this module also some kind of maintained by disqus.com people or is this just an Drupal developer maintaining this module? ... Ah no, it looks like someone of Acquia is the maintainer.
Comment #27
barrapontoA) With 2012 features enabled, the module doesn't break, but it doesn't change the language either (will use the default set in Disqus.com).
B) I opened that issue, but I don't think their issue tracking is public :/
C) I'm just a Drupal developer. I stepped up to this issue because it affected my Brazilian blog. The mantainer is reachable from his user page, feel free to ping him.
Comment #28
lsolesen commentedFeature 2012 cannot be disabled once enabled: http://help.disqus.com/customer/portal/articles/526768-introducing-disqu....
There is a problem with Disqus and locale support when it is enabled (and all new accounts have it enabled). Therefore, this should either be postphoned until Disqus fixes it or be set as Needs work.
Comment #29
lsolesen commentedComment #30
capellicI tried using "Localization support", found this issue and ended up doing the brut force method via jQuery in my theme's JavaScript file. Thanks to all the comments above, I was able to get this done in 5 minutes. Here's my code:
Note that "Localization support" also has be checked for this code to work.
Comment #31
xiukun.zhou commented#2120211: Drupal lancode not equal disqus lancode
Comment #33
pianomansam commentedWith commit c60608e, this appears to be fixed.