Regarding Wikimedia:Signit-si-overlay-coreContent-right-wikt-section-id

Regarding Wikimedia:Signit-si-overlay-coreContent-right-wikt-section-id

Is this supposed to begin with a capital letter or can it begin with a lower-case letter instead?

Sabelöga (talk)22:53, 4 August 2022

The doc is clear: "Within the target Wiktionary, the html id anchor of the relevant section."

So look at Wiktionary and see how sections are anchored: If you have a page with a Summary, click on the language label, look at the URL, which is terminated by the "#anchor".

Note that this could be a more precise subsection for different lemmas, but here it just looks for the section for the relevant language.

Anchors are generated from the section name, Sections are not necessarily written with a leadnig capital, and some characters are reencoded to be, first of all, a valid ID for HTML5 (they can't contain spaces, only letters, digits, and some punctuations, so MediaWiki has to strip or replace some characters, but they are not necessarily limited to ASCII), and then a valid anchor (according to URI standard, which may urlencode some remaining reserved ASCII characters present in the HTML5 ID, and all remaining non-ASCII characters).

In Wiktionary, the MediaWiki software uses the builtin function {{ANCHORENCODE:Section name}} using MediaWiki rule that are more restrictive than what HTML5 requires, so it filters or reencodes a bit more characters ; the anchorecode function is not the same as urlencoding for the path part of URLs, or for queries strings after the "?", but before the first "#" prefixing the anchor).

So which term to use? It depends on the target Wkitionnary wiki where the referenced page will be hosted, and notably about its local language, and how it lists other language names: with the local translation, or with the native name. Usually on Wiktionnary wikis, local names are not used for section names (imagine that it could be written in another script, with which users are not familiar, and so they will have difficulties to browse the section to find the relevant language to lookup for definitions of lemmas for a given term or expression. Some wiki may adopt to present both the local translation, and the native name in section names, and may even allow to reference anchors to a section by using a language-neutral section ID (such as its BCP47 language code). In that case, this ID may be used as the anchor to use after the "#".

As each edition of Wiktionnary may adopt different presentations, linking to sections in their pages may vary (But I strongly suggest that they use templates to label their page sections, so that they will generate language-neutral identifiers, rather than IDs generated from the visible plain text (which could vary, easily, and could as well list some synonyms or orthographic variants of the language name, possibly written in multiple alternate scripts). Anchor IDs that are automatically generated by Mediawiki are not always even unique on the page and are not always usable as good anchors: that is something to be discussed with contributors of each Wikitionnary, because there's no universal way to reference sections within wikipage, and referencing them by the heading text of the section is not always working and is not always stable enough to manage when generating links from other pages or sites, that prefer "stable" and unique anchor IDs.).

For this reason you need to tune the format of the expected anchors that will work with the current presentation (i.e. its wikitext format) used by each target Wiktionnary edition.

Verdy p (talk)23:24, 4 August 2022
 

Hello Sabeloga, thank you for your translation. When you click on the TOC (aka menu, outline) of a wiki page to access a section, the url contains the html id anchor. Example:

For you, if you want to get the definitions from https://sv.wiktionary.org/wiki/lapin#Franska and similar page, then :

  • "si-overlay-coreContent-right-wikt-iso": "sv"
  • "si-overlay-coreContent-right-wikt-section-id": "#Franska"

If you prefer your community to use https://en.wiktionary.org/wiki/lapin#French :

  • "si-overlay-coreContent-right-wikt-iso": "en"
  • "si-overlay-coreContent-right-wikt-section-id": "#French"

But this system is still under construction so I may have to think to something more intuitive.

Yug (talk)13:23, 9 August 2022