Template:GetLabelFix

Documentation icon Template documentation[view · edit · history · purge ]

Description

edit

Function to retrieve the label of WD properties and items in the language determined by the lang= parameter in order to put them in the labels of the infoboxes.
The return takes into account the possible existence of an exception in the text of the label found in WD by another that is more closely aligned with what is to be displayed as the label of an infotape. For example, use shorter text, acronyms, or synonyms that better convey the content presented.

The list of exceptions also includes all those texts that, without having a WD property or reference element, must be shown in the infobox and are likely to be translated. For example, headers, label of manual parameters without WD, or those texts that are part of editing results after retrieval and processing (e.g. conversion of "No value" in another meaning)

In both cases - labels and texts - can be retrieved by specifying the property code (Pnnnn), the code of an item whose definition fits the text we need (Qnnnnn) or a special text that we will handle in the list of exceptions (Tnnn).

Exception handling

edit

The exception list is defined in Module: Wikidades/labels in the infoboxLabelsFromId.

When any of the Pnnnn or Qnnnnn texts that returns do not match what we expected, for example, if the text displayed in the language we are trying is too long or the wording is not the best infotype label, could be fixed:

  • modifying the property label / item directly to WD. This is not always possible because we may be altering its meaning and impact on all users of this content.
  • if we do not want or cannot change the name of the property / item in WD, you can create an exception for that case in Module:Wikidades/labels and it will be applied instead of the text that WD would supply to us, without need to modify the cell code.

Syntax

edit
 {{GetLabelFix | <code> | lang = <language> | linked = yes / no}}
Parameters
  • the first is positional: Required. Code to get the text from the WD label in the corresponding language. It can be:
    • Pnnn, to retrieve the label of a property
    • Qnnnnnn, to retrieve the label of a WD item
    • Txxx, to retrieve a defined text in the exception list not from WD
  • lang: optional. Language code to retrieve the label defined in code. By default, use the local language.
  • linked: optional. "yes" indicates that the returned value will be a link to the local wiki article or, to the WD item, if there is no article. By default, return unlinked text.

Maintenance

edit

Different situations:

  • Add a new parameter (label + data) to the cell:
    • If you retrieve a WD value, simply add a call to this template, setting as the parameter the property / item code from which we want to retrieve the label.
    • If it is a text type Tnnn, that is, it cannot be retrieved from WD, a new entry must be made in Module:Wikidades/labels with the following available code "Tnnn" and put the text we want for the label. A call to this template will be added to the Infotaula, setting the new "label" code as the first parameter.
  • Create an exception to change the text resulting from a call with type code Pnnn or Qnnnnn:
    • Add an entry in Module:Wikidades/labels with the same code that we want to replace so that its value is added before that of WD.