Topic on User talk:SPage (WMF)

Use of <tt>

3
Summary by SPage (WMF)

Need to ask wikitech-l, probably kbd is better.

Ciencia Al Poder (talkcontribs)

Just FYI, the use of <tt> is obsolete, that why it was changed to <code>.

Also, making such changes in translation units where that's the only change, unless I'm wrong and the Translate extension is able to merge it transparently, is disruptive for other languages, forcing translators to check what's changed and update those units (otherwise, the text is reverted to English unless the translation is checked). Would you make those changes on the translated pages if the translation is approved?

SPage (WMF) (talkcontribs)

Hi there. tt has exactly the right semantics and appearance for a filename, see http://www.w3.org/TR/html4/index/elements.html : fixed-width text without the shading of <code>. If everything uses <code> then paragraphs become much harder to read with too many bordered text spans. A filename is not computer code nor is it instruction to a computer, but it's not regular English either. I believe I'm making wiki pages easier to read by replacing <code> with <tt>.

But you're right, it's obsolete and generates errors in HTML5 validators. Is that a showstopper? I'd like to take it to the experts at mail:wikitech-l.

If it is, then I think <span style="font-family:monospace"> gives the same effect in some browsers, though it's a complete pain to type. Maybe we could have a <span class="tt">. However, when I try it, weird stuff happens in Firefox :-(

  • You then edit LocalSettings.php (tt)
  • You then edit LocalSettings.php (styled span)
  • You then edit LocalSettings.php (kbd)
  • You then edit LocalSettings.php (code)


I don't want to needlessly mess up translations. I frankly don't understand the inner details of how they work. If all that's changed is markup, it seems translators would just make the same change. When you say

> "Would you make those changes on the translated pages if the translation is approved?"

I'm not sure what you mean by "if the translation is approved", approved by whom? Are you asking me to make markup changes to all translations that get reverted to English because of my efforts to improve legibility? I guess so.

For templates invoked with {{TNT}} I've learned the only way to see a fix is to click the link in "since it was last _marked for translation_." Otherwise I don't mark for translation. When someone does click _marked for translation_, Special:PageTranslation has a checkbox "Do not invalidate translations", it seems that person could check it seeing as this is just a minor, but worthwhile, presentational thing.

Thanks for bringing this up, it's worth getting right.

Ciencia Al Poder (talkcontribs)

Thanks for the reply.

I don't think using <tt>, although being obsolete, would cause problems (at least for now), but it's worth using alternatives instead of continue using it, or even using it on new places.

You're right, LocalSettings.php is a file name and there's no semantic way to represent it. Still, we can use kbd instead, since arguably, it's a filename and is something that can be typed on a console terminal...

I don't have access to translation stuff, except editing translations, so I don't really know how this works, but usually I found Translate extension not to apply such changes cleanly and they need to be manually applied on all translations. That's why you should be aware of this, and avoid such trivial changes on translated pages. Fortunately, this page is only translated on few languages, so those translation units are generally not translated anyway.

Reply to "Use of <tt>"