Template talk:Circa/Archive 1

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

Problems with invisible span

The trick with the invisible span causes problems in common uses of {{Circa}}. For example, in Philitas of Cos # Life, the following image:

[[Image:Ptolemaic-Empire-300BC.jpeg|thumb|left|alt=Map of eastern Mediterranean, showing the Ptolemaic Kingdom, Alexandria in the north of Egypt, and Cos in the Aegean just off the coast of Asia|The [[Ptolemaic Kingdom]], {{circa|300 BC}}, was centered on [[Alexandria]] in [[ancient Egypt]]; [[Kos|Cos]] was on its northwest frontier.]]

generates the following HTML

<div class="thumb tleft">
<div class="thumbinner" style="width:182px;"><a href="/wiki/File:Ptolemaic-Empire-300BC.jpeg" class="image" title="The Ptolemaic Kingdom, 300&#160;BCc.&#160;300&#160;BC, was centered on Alexandria in ancient Egypt; Cos was on its northwest frontier."><img alt="Map of eastern Mediterranean, showing the Ptolemaic Kingdom, Alexandria in the north of Egypt, and Cos in the Aegean just off the coast of Asia" src="http://upload.wikimedia.org/wikipedia/commons/thumb/b/bc/Ptolemaic-Empire-300BC.jpeg/180px-Ptolemaic-Empire-300BC.jpeg" width="180" height="141" class="thumbimage" /></a>
<div class="thumbcaption">
<div class="magnify"><a href="/wiki/File:Ptolemaic-Empire-300BC.jpeg" class="internal" title="Enlarge"><img src="/skins-1.5/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div>
The <a href="/wiki/Ptolemaic_Kingdom" title="Ptolemaic Kingdom">Ptolemaic Kingdom</a>, <span style="display: none;">300&#160;BC</span><a href="/wiki/Circa" title="Circa">c.</a>&#160;300&#160;BC, was centered on <a href="/wiki/Alexandria" title="Alexandria">Alexandria</a> in <a href="/wiki/Ancient_Egypt" title="Ancient Egypt">ancient Egypt</a>; <a href="/wiki/Kos" title="Kos">Cos</a> was on its northwest frontier.</div>
</div>
</div>

Notice the underlined text "300&#160;BCc.&#160;300&#160;BC". It is incorrect, since it attempts to render the "invisible" text into the image's title text. This causes the tooltip to contain some garbage.

Worse, even in plain text, the trick causes text browsers such as Lynx to display the "invisible" text, thus messing up the message, thus hurting WP:ACCESSIBILITY.

To fix this, I propose we remove the invisible-text trick, as is done in this obvious sandbox edit. Eubulides (talk) 22:59, 8 September 2009 (UTC)


And what about the many, many places that want to use {{circa NUMBER}} in a sortable table? You'll then break all of them. —ras52 (talk) 00:35, 9 September 2009 (UTC)
In any case, the text you quote is rendered:

The <a href="/wiki/Ptolemaic_Kingdom" title="Ptolemaic Kingdom">Ptolemaic Kingdom</a>, <span style="display: none;">300 BC</span><a href="/wiki/Circa" title="Circa">c.</a> 300 BC, was centered on <a href="/wiki/Alexandria" title="Alexandria">Alexandria</a> in <a href="/wiki/Ancient_Egypt" title="Ancient Egypt">ancient Egypt</a>; <a href="/wiki/Kos" title="Kos">Cos</a> was on its northwest frontier.

...which looks perfectly fine to me.—ras52 (talk) 00:44, 9 September 2009 (UTC)
  • We have to balance the many occurrences inside sortable tables against the many, many more places that use {{circa}} outside sortable tables. All those places are broken now, for text browsers like Lynx, and more generally, for visually-impaired readers who use a screen reader such as JAWS or Orca, as well as for graphical browsers such as Firefox and Internet Explorer.
  • The text I quote is rendered as I stated, and the underlined part is the part that's in error. The part that you quoted indeed does not contain the error, and does look perfectly fine. But that's not the problem. The problem is in the part that you didn't quote.
  • Let me give a simpler example of the error:
[[File:Bad Title Example.png|100px|{{circa|1550}}]]
This generates the HTML:
<a href="/wiki/File:Example.png" class="image" title="1550c.&#160;1550"><img alt="1550c.&#160;1550" src="http://upload.wikimedia.org/wikipedia/en/thumb/7/70/Example.png/100px-Example.png" width="100" height="108" /></a>
which displays as:
c. 1550
This image's title attribute and alt attribute are both "1550c. 1550", which is clearly wrong. This error causes a screen reader to say something like "1550 cee dot 1550", instead of the correct "cee dot 1550", which hurts WP:ACCESSIBILITY. It also causes a typical graphical browser to generate a tooltip that says "1550c. 1550" instead of the correct "c. 1550". I can see that bug right now by hovering my mouse over that sample image.
Eubulides (talk) 07:49, 9 September 2009 (UTC)
As a compromise I'm inclined to install this simple change, which generates the sortable-but-less-accessible output if a new "sortable=yes" parameter is specified. This should support users who prefer the behavior in sortable tables even though it makes the tables less accessible. Eubulides (talk) 19:55, 10 September 2009 (UTC)
I systematically searched through Wikipedia pages to find all articles that used {{circa}} inside a sortable table. There were four such articles; I fixed them all to use the new "sortable=yes" parameter. Here are the changes I installed to these four pages:
This removed the main objection to the proposed change, so I installed it. Eubulides (talk) 20:33, 10 September 2009 (UTC)

Spacing

The spacing between the c. and the year seems unnaturally large (on Vista FF 3.5.5), when the year starts with a 1 (as most years are inclined to do). Is there anything that could be done? CSS? A narrow space character? OrangeDog (τε) 01:32, 19 November 2009 (UTC)

We can't replace &nbsp; with &thinsp; because the latter can be replaced by a line break. We could try replacing it with &#8239;, the NARROW NO-BREAK SPACE (U+202F) introduced in Unicode 3.0 for Mongolian. Here's what it looks like:
  • c. 1066 (from "c.&#8239;1066")
  • c. 1066 (from "c.&thinsp;1066")
  • c. 1066 (from "c.&nbsp;1066")
Does the first line work better for you? We can't use the second line, due to the line-break problems with it. Eubulides (talk) 06:41, 19 November 2009 (UTC)
No, they all render exactly the same. I don't think there's a sensible way to hack around a kerning issue. Non-sensible methods include adding a span with negative left margin. OrangeDog (τε) 20:04, 19 November 2009 (UTC)
That's odd, because the first two lines do show thinner spaces for me. (They're equally thin.) I observe a thinner space both with Chromium 4.0.245.0 (Developer Build 31616) and with Firefox 3.5.5. I don't have easy access to Vista, though. I agree that negative spans would be a no-no. Perhaps we should use "&#8239;" anyway? After all, it helps with some browsers, even if it doesn't help with them all. Eubulides (talk) 04:11, 20 November 2009 (UTC)
On a different computer now (XP SP3, FF 3.5.5), which doesn't have a font for "&#8239;", and it displays a unicode box. The "&thinsp;" does give a thinner space though. Looks like there's nothing to be done short of removing the space altogether. OrangeDog (τε) 13:09, 20 November 2009 (UTC)
With Chrome 3.0.195.33 on Vista, I see the spacing differences between each one, but they're very small. (If it wasn't for an aperture grille, I probably wouldn't be able to tell the difference between the first two.) On IE7 on Vista, at normal resolution, the first two are indistinguishable, the third is larger—but zooming in, the differences between all are apparent. That's consistent with other observed behaviour on IE7—spacing is very granular, even with finely-tuned CSS. &#8239; works for me; it's unfortunate that XP doesn't seem to support it natively. TheFeds 16:02, 20 November 2009 (UTC)

Ouch: I think that Unicode box effectively ends the question about whether we can use some other character. (We can't use "&#thinsp;" due to the line break problem.) But hey! I have another idea! How about this?

  1. c. 1066 (from "c.&nbsp;1066"; the current behavior)
  2. c. 1066 (from "c.<small>&nbsp;</small>1066")
  3. c. 1066 (from "<small>c.&nbsp;</small>1066")

This should work with any browser. On my Firefox 3.5.5, it makes the no-break space a tiny bit smaller, but every little bit helps, no? I mildly prefer (3) to (2), and (2) to (1). How about you guys? Eubulides (talk) 20:34, 20 November 2009 (UTC)

Number 2 looks good. Should help make it less jarring to the text flow. OrangeDog (τε) 00:22, 21 November 2009 (UTC)
2 looks good; 3 looks a bit strange. Another option: we could use <span style = "white-space: nowrap">c.&thinsp;{{{1}}}</span>c. 1066 if we want to use the thin space character, but want to prevent wrapping.
  1. c. 1066 (from "c.&nbsp;1066"; the current behavior)
  2. c. 1066 (from "c.<small>&nbsp;</small>1066")
  3. c. 1066 (with the HTML thin space, and CSS nowrap)
TheFeds 04:37, 21 November 2009 (UTC)
Thanks for that suggestion. #3 looks best to me. I got bold and installed it. Eubulides (talk) 16:05, 21 November 2009 (UTC)
I just made a change to implement it with CSS instead of {{nowrap}}, to avoid transcluding it for such a simple case. I doubt we'll see any substantial change to the behavior of {{nowrap}} that will need to be applied automatically here, so this should be robust, and won't run afoul of the preprocessor node count limit. (Was there a specific intent to transclude {{nowrap}}, or just to keep the text non-breaking?) TheFeds 23:39, 21 November 2009 (UTC)
No, no intent, and the change is of course fine. Thanks. Eubulides (talk) 07:27, 24 November 2009 (UTC)

Italics

A recent edit altered the template so that the "c" or "circa" is italicized. Wikipedia:Manual of Style (text formatting) #Foreign terms says "Loanwords or phrases that have common use in English, however—praetor, Gestapo, samurai, esprit de corps—do not require italicization. If looking for a good rule of thumb, do not italicize words that appear in Merriam-Webster Online." Merriam-Webster lists "circa" as an English word, so under that guideline "circa" should be in roman, not italics. Perhaps we should add an option to italicize the "circa", for editors that prefer italics despite the guideline? Is there a common name for such a parameter? Eubulides (talk) 23:44, 23 November 2009 (UTC)

I added support for this to Template:Circa/sandbox, using the parameter named |i=. For example, "{{circa/sandbox|i=''|1320}}" → "c. 1320". Eubulides (talk) 07:26, 24 November 2009 (UTC)
Oh, sorry, didn't realise this was contentious - I thought all foreign words (and hence their abbreviations) must be italicised; hence fl., but d., for instance. It Is Me Here t / c 07:24, 25 November 2009 (UTC)
Circa is an English word (we stole it from Latin, and it's ours now!), so it doesn't need to be italicized. Of course, some people like to italicize it (I guess they're using the Latin word, not the English word...) so there should be an option to italicize it. The Wikipedia style guide says that in cases like these, the word shouldn't be italicized (see the 1st comment in this thread). I'll install the change. Eubulides (talk) 07:59, 25 November 2009 (UTC)

What's with the dotted underline?

What's with the dotted underline? It's something I've never seen it in history books or populist scientific articles? I thought there was a mark on my screen! Kevin McE (talk) 16:57, 27 January 2011 (UTC)

It is the default browser style for abbr elements. Move the mouse over it and a tooltip will appear. OrangeDog (τε) 19:09, 27 January 2011 (UTC)

Edit request

{{editprotected}} If the default is to remain unlinked, the following line should be removed and the documentation updated.

  |abbr= <abbr title="circa">c.</abbr>

OrangeDog (τε) 19:13, 27 January 2011 (UTC)

I've left abbr in as I think the code is more clear like that? Documentation can be updated by anyone of course. — Martin (MSGJ · talk) 12:28, 28 January 2011 (UTC)

sortable=yes not compatible with

{{Dts}} inserts a "0" before the year for sorting. Circa doesn't, which messes with sorting. In the following table, only Rarebit Reveries uses {{circa}}:

Comic strips by Winsor McCay
Title Begin date End date
Little Sammy Sneeze July 24, 1904 December 9, 1906
Dream of the Rarebit Fiend September 10, 1904 June 25, 1911
January 19, 1913 August 3, 1913
Little Nemo in Slumberland October 15, 1905 1914
1924 1927
Rarebit Reveries 1923 c. 1923 1925 c. 1925

CüRlyTüRkeyTalkContribs 02:10, 13 December 2012 (UTC)

Correct the default setting

Practically no one but the already-invested will show up here, but I'd like to record my support for any move the correct this template. The default should be a c. with a simple non-ugly thin no-break space; the default should not be anything with unsightly dotted underlining.

I'm not saying we should remove the feature or the functionality; but the extra typing should be on the part of those wanting to make their pages uglier and their use of this template overly distracting. — LlywelynII 14:43, 19 February 2013 (UTC)

Fwiw, yes, less annoyed now that I see I can use {{c.}}. Still... ;) — LlywelynII 14:45, 19 February 2013 (UTC)