MediaWiki talk:Signature

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

talktalk?[edit]

Hope this wasn't intentional. :) Rocket000 (talk) 17:36, 6 August 2008 (UTC)[reply]

Nevermind. Fixed now. Rocket000 (talk) 17:37, 6 August 2008 (UTC)[reply]

Talk link localisation[edit]

User:Slomox and me worked on the localisation of the (talk) link in the signature. This is how it works:

  • the default value talk is wrapped in a span with class signature-talk. (this is backwards compatible with textbased browsers and systems without CSS and JS).
  • a Javascript snippet in MediaWiki:Common.js sifts through all span tags with class signature-talk and adds class signature-talk-wgUserLanguage to them.
  • in MediaWiki:Common.css are the translations

I just noticed a major drawback would be the increased length of the signatures. :-( Maybe we can do without css and just do a string replacement in JS. Hmmm.... --Dschwen (talk) 17:57, 6 August 2008 (UTC)[reply]

It is pretty long for a default sig. Rocket000 (talk) 19:30, 6 August 2008 (UTC)[reply]

Oh, boys! You can’t do that!

  1. In your solution, there is no fallback at all if the user’s language is not one of those supported, and all such users will see nothing (empty parentheses).
  2. Using CSS :after pseudoclass does not work at all in IE (except IE8 beta), and again, there is no fallback at all, so all IE users see nothing.

I have changed the JS code to do the localization itself, which should solve both problems. Still, I am not sure if this is a good idea at all (and its solution is also not perfect – walking through all spans, consider big pages…), but I’ll be able to live with it. --Mormegil (talk) 20:38, 6 August 2008 (UTC)[reply]

Well, actually there was a fallback (until it was removed). A solution completely in CSS would be faster than a JS solution, but it will only work, if the language of the user interface is made available for CSS (by adding a language-specific class to the HTML body-element). See Commons:Village pump/Archive/2008Jul#Default signature --Slomox (talk) 20:51, 6 August 2008 (UTC)[reply]

Have you read my #2 point? You can’t use :after, it does not work for all IE users! You can add a language-specific class to the HTML body element using a simple JS (so that the JS makes one tiny change, instead of walking through all spans), but once again: you are not able to modify displayed text using CSS only in a way that would work for all platforms. (You might use images, but that does not seem like a good idea to me. ;-) ) --Mormegil (talk) 21:43, 6 August 2008 (UTC)[reply]

Yes, that is much better. The thing Slomox pointed to [1] was not a fallback at all. This [2] was supposed to be the fallback. But the JS didn't check whether the CSS class for a given language existed. My bad. Using JS only will not be slower than a JS+CSS mix, so I guess this solution is just fine. Unfortunately I only had IE8b here to test it. Should have known that something this elaborate wouldn't work in any older IE anyways ;-). --Dschwen (talk) 21:50, 6 August 2008 (UTC)[reply]

Ok, I've waited a couple days but the problem still hasn't gone away. About 10% of time all I see is "Name ( )". I'm using Firefox 2, default English interface. Other people are experiencing this too. I don't know if it's a caching or what. Rocket000(talk) 07:21, 9 August 2008 (UTC)[reply]

Wow... that was easy. Rocket000(talk) 07:28, 9 August 2008 (UTC)[reply]

Translation, attempt 2[edit]

Right now it seems this CSS and/or JS translation isn't working. What I see is as a result ugly code that does nothing, namely <span class="signature-talk"> . Unless someone knows what it is currently I would like to propose replacing the template with, something like this:

[[User:$1|$2]] ([[User talk:{{#ifeq:{{FULLPAGENAME}}|User talk:$1|$1#top|$1}}|{{int:talkpagelinktext}}]])

The reason I say like it and not it is because it seems to be hard-subsituted. Any kind of (in)direct template wont work (tested it on a local test wiki). Perhaps we can find a way around that. Other wise I'll see if I can fix the javascript solution (probably not that hard) –Krinkletalk 17:49, 11 July 2010 (UTC)[reply]