[uf-discuss] An Inconvenient hCard

Paul Wilkins paul_wilkins at xtra.co.nz
Tue Mar 20 15:55:34 PST 2007

From: "Ara Pehlivanian" <ara.pehlivanian at gmail.com>
To: "Microformats Discuss" <microformats-discuss at microformats.org>
Sent: Monday, March 12, 2007 1:06 PM
Subject: [uf-discuss] An Inconvenient hCard

> I've got a bit of a problem with an hCard that I need to mark up and I
> was wondering if anyone could lend me a hand.
> I realize the syntax requires that a type be specified for telephone
> numbers ("voice", "fax", etc...) and that's where my problem lies.
> It's inconvenient to have the word "voice" appear in the markup
> because that's not how the convention (at least in this neck of the
> woods) is when writing out contact information. The final display
> should be:
> Tel.: (514) 123-4567
> Fax: (514) 123-4568
> Yet with the required "voice"/"fax" types it ends up like this:
> Voice Tel.: (514) 123-4567
> Fax Fax: (514) 123-4568
> or in the French version of the page:
> Voice Tél.: (514) 123-4567
> Fax Téléc.: (514) 123-4568
> I realize that it's simple enough to just hide the types via CSS, but
> being the strict standards advocate that I am, I don't like entangling
> the structural layer with the presentational one by making it
> dependent on it. The idea of superfluous words littering my markup
> without proper grammatical consideration doesn't sit well with me.
> I thought of doing something like this:
> Tel.: (514) 123-4567 (Voice)
> Fax: (514) 123-4567 (Fax)
> or in the French:
> Tél.: (514) 123-4567 (Voice)
> Téléc.: (514) 123-4568 (Fax)
> But it's redundant in English and nonsensical in French.
> So, dear Microformats community, please lend me a hand and help me
> unravel this conundrum of mine.

I have a creative solution here for you, inspired from
Fax Téléc.: (514) 123-4568

If the page is in a foriegn language, such as French, you really should mark 
up non-French words with the appropriate language attribute
HTML - lang
XHTML 1.0 - lang and xml:lang
XHTML 1.1 - xml:lang
<span xml:lang="en">Fax</span>Téléc.: (514) 123-4568

Then you can use a stylesheet to hide the english word.
span [lang=en] {display: none;}

Let's take this one further. Markup the new code as a telephone microformat.

<p class="tel">
    <span class="type" xml:lang="en">Fax</span>
    <span class="value">(514) 123-4568</span>

And hide the english text inside the microformat
.tel [lang=en] {display: none;}

Paul Wilkins 

More information about the microformats-discuss mailing list