మూస:head
- The following documentation is located at Template:head/doc. [edit]
- Note: Please move the documentation subpage to Template:head/documentation.
This template is used on headword lines for languages that do not have specific headword line templates.
The basic usage is:
- {{head|(lang)|(POS)|...}}
The first parameter is the language code, second is the part of speech. Then (if applicable) the inflections, paired with the inflected forms. For example, in the Sandbox:
- {{head|en|noun|plural|Sandboxes|irregular plural|Sandboxen}}
generates:
The second part of a pair may be blank, to add a descriptive term, such as uncountable or intransitive: on page 政治 (“politics”):
- {{head|ja|noun|uncountable||hiragana|せいじ|romaji|seiji}} and
- {{head|cmn|noun|traditional and simplified||Pinyin|zhèngzhì}}
would generate:
(Of course in this case the {{ja-noun}} template is to be preferred for various reasons: it doesn't bold kanji forms (which makes them unreadable at the normal font size), it selects a shinjitai font, it sorts categories by hiragana, etc. Likewise for Mandarin – see 政治, which uses {{cmn-noun}}.)
The template also categorizes the entry in [[Category:(lang) (POS)]] if it exists, else in [[Category:(lang) language]] if it exists.
The language should have a code template: i.e. {{en}} is defined as "English". (not that one should use this for English)
Options
[<small>మార్చు</small>]Note that most invocations of {{head}} should be fairly simple; if a significant language requires a complex call a large amount of the time (such as using sort= in every entry), the language should probably have its own templates.
While named options can be used anywhere, they should be after the language and POS to make it easier on bots.
- g= one of f, m, n, c, s, p (for feminine, masculine, neuter, common, singular, or plural); adds the gender or number marker after the headword/pagename. g=g will add a request to supply the gender. For more than one, such as పురుషుల పేరు, also use g2=, g3=. If there are other cases, g should be the template or code desired, g={{template}}
- head= specifies a different headword.
- Particularly useful for Idioms|(idiomatic) phrases, which allow one to link individual words or subphrases.
- tr= specifies the transliteration of the headword
- sort= specifies a category sort key other than the headword/pagename.
- cat= specifies the second part of the category name if different from the POS, must be plural. (Most POS names in English take -s) The case of POS in (prefix, suffix, affix, infix) is handled by the template.
- cat2= and cat3= specifies the secondary part of the category names for additional categories.
- sc= headword script template; e.g. for Arabic, one should use sc=Arab (which see: {{Arab}})
An example, on page تايلاندي
- {{head|ar|noun|sc=Arab|g=m|tr=tailándi}}
yields:
- تايلاندي (tailándi) పురుషుల పేరు
and the correct categorization in Category:Arabic nouns. The parameter sc=Arab can be omitted, as {{ar/script}} gives 'Arab'.
Notes
[<small>మార్చు</small>]This template should chiefly be used when there is no language specific template. With 7000+ languages to be included in the English Wiktionary, most will never have specific templates.
- Simple forms like {{head|en}} or {{head|it|noun|g=f}} work as expected.
- When a template is created for a language, it is an easy task for a bot to replace head with the language-specific template.
- For example, it is trivial to replace {{head|en|noun|plural|foo}} with {{en-noun|pl=foo}}, a more sophisticated bot will recognize the regular forms.
- A bot doesn't have to try to parse the language and POS headings.
- This template makes it much simpler for a bot to generate entries for the inflected form if desired. It has the language code and the POS to use.
- It uses the existing categories as available. If new POS categories are added, they will be used. (modulo some job-queue magic and such)
- It automatically wikilinks its parameters if not already.
- Presently it takes 7 parameter pairs, if more are needed look at the source, it is obvious how to add another one.
- If the language does not have a code template, the inflection line will display properly, but the entry will not be categorized. If the code template is added later, it will (eventually) appear in the category.