MediaWiki:Gadget-WiktAccFormCreation.js/belge

Ev amûr formên peyvan nîv otomatîkî çêdike.

ClickedCheckbox.jpg WF:BILEZ — amûreke ji bo çêkirina formên peyvan bi nîv-otomatîkî. (belgekirin)

bitikîne.


Acceleration tags

The following is a list of tags that you can add to links to enable accelerated forms to be created. Each tag is associated with either (a) a template parameter to provide it when used with link templates such as {{l}} or {{l-self}}; (b) a key in the table passed as the |accel= key in the |data= parameter to the |full_link()= function in Module:links, when called from a module.

|form= (in modules) or |accel-form= (in templates)

Which particular form the link is for. It should use the inflection codes used in {{inflection of}}, with pipe symbols (vertical bars) separating the inflection codes. When called from a module, use the pipe symbols directly, e.g. |{{{1}}}= for nominative masculine plural. When used in template code, you will need to encode the pipe symbols using {{!}}, e.g. |accel-form=nom{{!}}m{{!}}p. You can also specify arbitrary text such as comparative-of, but this must be interpreted by a language-specific module (such as Module:accel/ru for Russian) and converted into the appropriate definition. This is the only tag that is mandatory.

|gender= (in modules) or |accel-gender= (in templates)

The gender code that should be added to the headword line, using the same format that {{head}} uses, e.g. m-p for masculine plural. This should only be needed in rare occasions. If the definition already mentions the gender, like "feminine form of" for example, then this is redundant and you should not add it.

|translit= (in modules) or |accel-translit= (in templates)

The transliteration that should appear on the headword line. The value of this parameter goes into param |tr= of the call to {{head}} in the accelerated entry. You only need to specify this for languages that use a non-Latin script, and only when the auto-generated transliteration is insufficient, incorrect or nonexistent.

|lemma= (in modules) or |accel-lemma= (in templates)

The lemma to be included in the call to {{inflection of}} on the definition line. The value of this parameter goes into param |2= of the call to {{inflection of}}. It defaults to the name of the current page, and only needs to be specified when the lemma contains additional diacritics that are stripped in order to generate the pagename (as in Latin, Russian, Ancient Greek, Old English, etc.).

|lemma_translit= (in modules) or |accel-lemma-translit= (in templates)

The manual transliteration of the lemma to be included in the call to {{inflection of}} on the definition line. The value of this parameter goes into param |tr= of the call to {{inflection of}}. You only need to specify this for languages that use a non-Latin script, and only when the auto-generated transliteration is insufficient, incorrect or nonexistent.

|nostore=true (in modules) or |accel-nostore=true (in templates)

Normally, the forms on a page are processed in reading order (left to right, top to bottom), and the entries/definitions will be added to the page in that order. This tag is used when the same form appears multiple times in a page/inflection table, and causes a particular link to be ignored for the ordering. This is useful when an inflection table shows some forms in its collapsed state, like for example {{se-infl-adj-even}} or {{nl-conj-wk}}. By placing this tag on the links that appear in the collapsed state, their forms will not be shown before the forms in the rest of the table.

Adding the tags to a template

There are various ways to add accelerated creation to links, both in templates/wikicode and in modules/Lua. Acceleration tags should not be added directly to entries, there should always be a template that wraps around it.

Links that are created with the standard linking templates {{l}}, {{l-self}} and such have parameters for each of the tag types listed above, with the name prefixed with accel-. Thus, for the form tag, you use the accel-form= parameter, e.g.

{{l-self|en|foos|accel-form=p}}

If you are working in a module using the full_link function of Module:links, the accel key can be provided as one of the values in the table that's passed as the first parameter. The value should be a table containing the acceleration tags as keys, e.g.

full_link({lang = lang, term = "foos", accel = {form = "p"}})

When working on a headword template, you'll typically be using {{head}}, and providing it with one or more inflected forms to show on the headword line. To provide acceleration tags for the inflected forms, the tag name is prefixed with fNaccel- N stands for the number of the form, e.g.

{{head|en|noun|plural|foos|f1accel-form=p|diminutive|bar|f2accel-form=diminutive}}

In a module using the full_headword function of Module:headword, you provide the accel key in the list of inflections of a particular label. Its value is a table of tags, like as with Module:links, e.g.

full_headword({lang = lang, inflections = { {label = "plural", accel = {form = "p"}, "foos"}, {label = "diminutive", accel = {form = "diminutive"}, "bar"} }

When you're done, add {{bilezkirî}} to the documentation page of the template. This shows a notice that accelerated links are enabled for this template. It also adds the template to Kategorî:Şablonên ku hatine bilezkirin.