Currently, Wikibase accepts only one way for defining sitelinks. Historically, the site ID of the site (its ID in sites table) matches their canonical database name .
It is not uncommon for WMF wikis to have their site ID changed
**Example: **"Belarussian Taraškievica" Wikipedia use to have a site ID `be_x_oldwiki`, which is also wiki's database canonical name. At some point the wiki has been renamed to `be-taraskwiki`. The `be_x_oldwiki` remained to be stored in the database as a "canonical site ID", but it is `be-taraskwiki` which is primarily used in the UI and expected in the user input (UI and API)
**Change requested: **There will be a configurable site ID aliases to be used in favour of "canonical" site IDs**
**Acceptance criteria:**
[] Configuration option have been create that allows to defined aliases for "canonical" site IDs
[] Configuration is documented in `options.md`
[] The canonical site ids are still used for storage in JSON and other indexes.
[] Alias site IDs are only allowed consist of lower-case Latin letters (a-z) and hyphens
[] alias site IDs are allowed to be used in the input in the sitelink editing UI
[] alias site IDs are the IDs presented to the user in the sitelink editing UI
[] One of the aliases is configured as the "label" to be shown in the UI - especially for cases when there are multiple aliases per "canonical site ID"
[] alias site IDs are presented in the JSON output provided by Wikibase APIs (including Special:EntityData)
[] One of the aliases is configured as the "label" to be shown in the API output - especially for cases when there are multiple aliases per "canonical site ID"
[] The change in the the JSON output should be configurable, so it could be enabled on demand, to allow WMDE to follow the Stable Interface possible
[] alias site IDs are allowed to be used in the input to Wikibase APIs (eg. wbeditentity)
[] Special:GoToLinkedPage, Special:ItemByTitle accept all alias Site IDs, as well as the canonical site ID
[] Default Wikibase configuration does not have any aliases
[] WMF production config is adjusted so that
[] `be-taraskwiki` is accepted as an site identifier when adding a sitelink to "Belarussian Taraškievica" Wikipedia (canonical site ID `be_x_oldwiki`)
[] "old" site IDs as `be_x_oldwiki are still accepted as site identifiers when adding a sitelink to a respective Wiki
[] `be-taraskwiki` is displayed in the sitelink editing UI when adding a sitelink to "Belarussian Taraškievica" Wikipedia
[] TODO: specify what characters are allowed in the alias site ID (it seems that underscores are not wanted to avoid funny behaviour in combination with T267791; would this be small case Latin letters and hyphens only?)
Originally part of T114772