(Go: >> BACK << -|- >> HOME <<)

build: Updating npm dependencies

* eslint-config-wikimedia: 0.28.0 → 0.28.2
* grunt-stylelint: 0.20.0 → 0.20.1
* stylelint-config-wikimedia: 0.17.1 → 0.17.2

Change-Id: Id08e01818131805638d4dcb00edcb43eeac14712
3 files changed
tree: 15326aa8f97ced91eca83e766057c2164f836ce6
  1. .phan/
  2. i18n/
  3. includes/
  4. modules/
  5. tests/
  6. .eslintrc.json
  7. .gitignore
  8. .gitreview
  9. .phpcs.xml
  10. .stylelintrc.json
  11. AUTHORS.txt
  12. CODE_OF_CONDUCT.md
  13. composer.json
  14. COPYING
  15. extension.json
  16. ExternalGuidance.alias.php
  17. Gruntfile.js
  18. package-lock.json
  19. package.json
  20. README.md
README.md

ExternalGuidance MediaWiki Extension

Wikipedia content gets exposed externally in different ways, and this project intends to make it easy for people to be able to return to the origin and contribute to it.

For example, a page might be machine translated and presented to user in an external site like Google translate. This extension informs the user about the translation and possibility of editing that page, by visiting the original wiki. The extension also removes or fixes some page features that won't work in such external contexts. For example, a user cannot edit from a Google translated page. So the edit links will be removed.

For more information about the extension, visit https://mediawiki.org/wiki/Extension:ExternalGuidance

Installation

Clone the repository as follows:

 cd extensions
 git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/ExternalGuidance.git

Add this to the LocalSettings.php to enable the extension

wfLoadExtension( 'ExternalGuidance' );

Configuration

Configure the external machine translation hosts that trigger this extension

To activate the External Guidance for certain machine translation services, you can configure their hostnames in ExternalGuidanceMTReferrers configuration. The value is an array. An example:

$wgExternalGuidanceMTReferrers = [ "translate.google.com", "translate.googleusercontent.com" ];

This means, if a MediaWiki page is presented to user by a host translate.google.com, this extension features will be triggered.

Configure site URL templates for other language wikis

Since this extension is for wiki systems with a wiki per language, we need to know how to navigate to those wikis. Also we will require to use the apis of those wikis. ExternalGuidanceSiteTemplates configuration allows to define them. The value for this configuration is a key-value pair as illustrated below:

{
    "view": "//$1.wikipedia.org/wiki/$2",
    "action": "//$1.wikipedia.org/w/index.php?title=$2",
    "api": "//$1.wikipedia.org/w/api.php"
}

Configure language to domain mapping

For various reasons, the domain name in the URLs for wikis may not be same as the language code. At least in wikipedia, that is the case. This configuration allows to define that mapping using ExternalGuidanceDomainCodeMapping configuration as illustrated below:

{
    "be-x-old": "be-tarask",
    "bho": "bh"
}

Enable or Disable external context detection

If the context detection is not required in a wiki, but want to have Special:ExternalGuidance to accept traffic from the context detected from other wikis, use the following configuration

$wgExternalGuidanceEnableContextDetection = false;