Modul:headword/doc

Vikilug‘atdan olingan

Bu sahifa Modul:headword uchun hujjat sahifasidir

Ushbu template hujjatiga kerak.
Hujjatlar sahifasida uning maqsadi va foydalanish tasvirlab, bu shablonni hujjatlarni qiling.

Ushbu modul jinsdagi tillarda kabi har qanday qoʻshimcha tushuntirishlar bilan birga, modda boshi soʻz satrlarni ko'rsatish uchun ishlatiladi. Bu submodule moduli orqali, andozalarini {{bosh}} tomonidan koʻnikib qolgan: Module:headword/templates.

format_headword[tahrirlash]

format_headword(boshlar, tili, sc)

Bu til obʼekt va skript uchun tegishli formati yordamida, bir modda boshi soʻz formatlaydi (qarang Module:script utilities#tag_text).

The heads parameter can either be a single string or a table of strings. If it's a table, then each string in the table is shown as a headword, separated by "or". This allows you to show multiple alternative headwords, such as when the same written form can be accented in different ways.

It has special behaviour in certain cases as well:

  • If an item in the heads parameter contains wikilinks, they are converted into language-section links for the given language (using Module:links#language_link, which is also used by {{l}}). For example, giving "[[give]] [[up]]" if the language provided is English will produce: [[give#English|give]] [[up#English|up]]. If string is prefixed with * or if any of the links are, then they are interpreted as reconstructed terms and it will create links to the appendix namespace as appropriate.
  • If heads is empty (nil or the empty table), it will default to mw.title.getCurrentTitle().subpageText (equivalent to {{SUBPAGENAME}} in templates).
    • If the page name contains spaces, it is split and each individual word is automatically wikilinked as above.
    • If the current page is in the appendix namespace, and the language's type (in Module:tili) is not appendix-constructed, then a * will be prepended to the headword to indicate that it is a reconstructed term.

format_transliteration[tahrirlash]

format_transliteration(tr, tili)

If the transliteration is specified and non-empty, adds some stuff before and after it. For example, if the transliteration is 'foo' and the language is Hebrew, produces

 [[Wiktionary:Hebrew transliteration|•]] (<span lang="">foo</span>)

which looks like “ (foo)”.

(Note: the bullet/link is only added if the linked-to page actually exists.)

format_genders[tahrirlash]

format_genders(genders, lang)

Module:jinsi va soni foydalanib format jinsi xususiyatlari. Ushbu funktsiya hozircha juda cheklangan qobiliyat bor, lekin koʻproq keyinchalik qoʻshilgan boʻlishi mumkin.

format_inflections[tahrirlash]

format_inflections(inflections, lang, sc)

Format a list (table) of inflections, which are then concatenated together with commas and surrounded by parentheses. For example:

format_inflections({"first", "second", "third"}, "en", "Latn")

gives:

 (first, second, third)

displays as: (first, second, third)

If an element of the table is itself a table, then it is taken to consist of a list of labelled inflections:

  • The table must have a .label value which contains the label. It is displayed in italics and not linked.
  • The table may optionally have a .accel value. This value is used to support accelerated entry creation using WT:ACCEL. The "form-of" and "lang-(code)" classes are added automatically, so only the "(form)-form-of" class needs to be given, along with any other classes that may be needed.
  • The table may optionally have a .nolink value. If true, this will tell the function not to link to the terms, but only display them.
  • Numbered values in the table are the actual forms. They are formatted in bold text and converted to a link to the term. If a term already contains a link, it is converted into a section link using Module:links#language_link, just like in format_headword.
  • Forms are optional. If the table contains only the .label, then just the label is shown with no forms. If there is more than one form, they are shown with "or" between them.

For example:

format_inflections({
    {label = "present", "krama"},
    {label = "past", "kramade"},
    {label = "past participle", "kramat"},
    "sv", "Latn")
format_inflections({
    {label = "plural", accel = "plural-form-of", "voorbeelden"},
    "nl", "Latn")

gives:

 (''present'' <b lang=\"sv\">[[krama#Swedish|krama]]</b>, ''past'' <b lang=\"sv\">[[kramade#Swedish|kramade]]</b>, ''past participle'' <b lang=\"sv\">[[kramat#Swedish|kramat]]</b>)
 (''plural'' <span class=\"form-of lang-nl plural-form-of\"><b lang=\"nl\">[[voorbeelden#Dutch|voorbeelden]]</b></span>)

displays as:

(present krama, past kramade, past participle kramat)
(plural voorbeelden)

It is also possible, but optional, to supply a table instead of a term. This table can contain the keys .term (the actual term), .alt (alternative display form), .sc (script), .id (sense id) and .genders (list of genders). These are used the same way as for full_link in Module:links, and are passed directly to it.

Misol:

format_inflections({
    {label = "diminutive", {term = "Hündchen", genders = {"n"}}},
    "de", "Latn")

gives:

 (''kichkina'' <b lang=\"de\">[[Hündchen#German|Hündchen]]</b> <span class=\"gender\"><abbr title="neuter gender">n</abbr></span>)

displays as:

(kichkina Hündchen n)

Proposed/planned changes[tahrirlash]

  • Uni qoʻllab-quvvatlash tillar uchun Avtomatik tarjima. Bu amalga oshirish uchun format_transliteration parametrlari oʻzgarishi kerak unutmang.
  • Muayyan til uchun amal qiladi roʻyxati jinsdagi bu, bemor jins uchun tekshirish.