Page MenuHomePhabricator

Accept Wikidata Q-IDs in url parameters to identify the topic to translate when loading and publishing
Open, MediumPublic

Description

Section translation supports different url parameters to select the page (page parameter) and languages to translate (from and to parameters).

The page parameter requires to indicate the page name, and does not provide much flexibility when translating from other namespaces. In the context of external tools, this can be a bit limiting in some cases. For example:

  • Tools generating links to translate a given topic into missing languages need to obtain the page name for each of them.
  • Preparing source articles to translaiton in a different namespace (e.g., a summarized version in the user namespace) cannot be published with the interlanguage link to the corresponding article topic (T329663).

This ticket proposes to include a parameter (wikidata-topic,topic-id, topic?) that takes a Wikidata Q-Id and uses it in the following way:

  • If the page parameter is missing/empty, load the page corresponding to the indicated Wikidata Q-Id. For example, a url with topic=Q405&from=en&to=ig parameters will load the Moon article, for translation.
    • This does not require the language parameters (fromand to) to be set, the confirmation step can show the source article selected in a default language, which the user can later change if needed. For example, a url with topic=Q405 will lead to the confirmation step with a deafult selection for source and target languages the user can change.
    • The page parameter takes precedence to determine the contents to load. For example, a url with parameters topic=Q405&page=user:Cronopio/MyMoonDraft&from=en will result on the translation of the contents of the contents from "user:Cronopio/MyMoonDraft".
  • When publishing a new article in the main namespace, connect the new article in Wikidata with an interlanguage link to the indicated Wikidata Q-Id item. For example, a url with parameters topic=Q405&page=user:Cronopio/MyMoonDraft&from=en will allow users to publish a translation into the main namespace and it will be automatically added as a language version of the Moon topic.