category is a field used in many microformats, originally taken from hCard 1.0.
Type name: CATEGORIES Type purpose: To specify application category information about the vCard.
It is closely related to rel="tag", but has no dependency on URL schemes, it simply marks up the inner-text as a category keyword.
Brainstorming on this page may be applicable to parsing of
category and/or rel="tag".
An object — a person, or item (in a hProduct or hListing draft context) — may be consumable in multiple languages. A person may communicate in multiple languages, a set of self-assembly shelves may come with an instruction manual in multiple languages, a web application (also a product) can be localized to support use in multiple languages.
In a loose form, supported language is a form of categorization, but it is useful to filter by language separately from other tags/categories (‘Only show me people that speak languages I speak’, ‘Only show applications available in my language’).
Language on the web are indicated in multiple forms on the web:
- Names (e.g. ‘Français’, ‘Deutsch’, ‘English (British)’
- Abbreviated local names ‘En’, ‘Fr’, ‘De’
- Abbreviated country names: ‘GB’, ‘UK’, ‘ES’
- Local names (e.g. ‘French’, ‘German’, ‘British English’, ‘Dutch’)
- ISO 639 language codes (e.g. 'en-gb', 'en', 'fr', 'de')
HTML already has a
lang attribute for marking up actual content. This uses ISO 639 codes.
Categorizing languages has the following requirements:
- Differentiate from other types of category
- Allow the language to be presented in local name form
- Allow the language itself to be ascertained reliably and interoperably
- Use an additional class-name
languageto indicate that a category is marking up a supported language for the object.
class=languagealso instructs parsers to read the ISO code from the
langattribute of the element, in place of the inner text, where present.
<ul> <li class="category language" lang="en-gb">English (British)</li> <li class="category language" lang="en">English (American)</li> <li class="category language" lang="fr">Français</li> <li class="category language" lang="de">Deutsch</li> </ul>
In HTML, the strings should be marked up with a lang attribute to ensure that the local named languages are pronounced correctly by screen readers (for example).
<ul> <li><a class='language' rel='tag' href='/apps/lang/en' lang='en'>English</a></li> <li><a class='language' rel='tag' href='/apps/lang/en-gb' lang='en-gb'>English (British)</a></li> <li><a class='language' rel='tag' href='/apps/lang/fr' lang='fr'>Français</a></li> <li><a class='language' rel='tag' href='/apps/lang/de' lang='de'>Deutsch</a></li> </ul>
In this case, the URL scheme is shown to also use ISO codes. This may not be the case in production environments (they may choose to use
/apps/lang/english, for example), so parsers look explicitly for language information should be instructed to again look for for the
lang attribute where rel-tag is used in combination with class-language.
--BenWard 01:16, 1 September 2009 (UTC)
- JonathanMalek 15:19, 1 September 2009 (UTC): I've been looking for ways to express more information about a particular category. For instance, when categorizing a particular hAtom 0.1 entry as "about Los Angeles, CA", it would be helpful to also mark up that particular rel-tag with the geo data for LA. Do you see this
categoryproposal as a way to support richer tags?