Translators of the documentation absolutely must use the [{}->artN]
notation when referencing article N in the documentation, thus allowing translators to recopy that short-cut link without ever needing to update it later. In fact what happens now, is that if article N does not exist in the same language as the text that includes the short-cut link, then the link will be converted into the URL for article N (which is the best fall-back condition we can make), but if there is actually a translation in the correct language, then the short-cut link will be converted into a URL for the other translated article instead. More precisely, this behaviour will be always observed for a reference in the private zone, whereas the public site adds a supplementary constraint in that the new translation must be actually published itself too, so that the generated URL is actually valid.
How is this made possible ? In fact, SPIP has for a long time permitted the use of braces to specify the value of the hreflang
attribute. The overloaded function introduced for this site simply consists of looking to see if the article designated by the short-cur exists in the language indicated by the hreflang
. If this is the case, then the short-cut for ->artN
is replaced by one for ->artP
, where P
is the published translation of N
.