Extension:Stick to That Language

From MediaWiki.org
Jump to navigation Jump to search
MediaWiki extensions manualManual:Extensions
Crystal Clear action run.svg
Stick to That Language

Release status:Extension status beta

ImplementationTemplate:Extension#type Page action, MyWiki
DescriptionTemplate:Extension#description Sticky 'uselang' parameter (language can be selected and stays when following internal links)
Author(s)Template:Extension#username Daniel Werner (Danwetalk)
Latest versionTemplate:Extension#version 0.1-rc (2012-08-09)
MediaWikiTemplate:Extension#mediawiki 1.20.0 or higher
PHPTemplate:Extension#php 5.3 or above
Database changesTemplate:Extension#needs-updatephp No
LicenseTemplate:Extension#license GNU General Public License 2.0 or later
Download
readme
release notes
ParametersTemplate:Extension#parameters
  • $egSTTLanguageDisplaySelector
  • $egSTTLanguageTopLanguages
Hooks usedTemplate:Extension#hook
GetPreferencesManual:Hooks/GetPreferences
UserGetDefaultOptionsManual:Hooks/UserGetDefaultOptions
SkinTemplateOutputPageBeforeExecManual:Hooks/SkinTemplateOutputPageBeforeExec
LinkBeginManual:Hooks/LinkBegin
BeforePageDisplayManual:Hooks/BeforePageDisplay
GetLocalURL::InternalManual:Hooks/GetLocalURL::Internal
AfterFinalPageOutputManual:Hooks/AfterFinalPageOutput

Translate the Stick to That Language extension if it is available at translatewiki.net

Check usage and version matrix.

The Stick to That Language extension allows to choose an interface language in a language selector. The uselang url parameter is used to set that language for the current page and will be added to all links to other internal pages. It introduces a user preferences option to choose preferred languages which will be displayed on top of the language selector.

Download[edit]

The extension can be retrieved directly from Git [?]:

  • Browse code
  • Some extensions have tags for stable releases.
  • Each branch is associated with a past MediaWiki release. There is also a "master" branch containing the latest alpha version (might require an alpha version of MediaWiki).
    • [[Special:ExtensionDistributor/StickToThatLanguage

|Browse branches]]

    • Select a branch name
    • Click "Continue"

Extract the snapshot and place it in the extensions/StickToThatLanguage/ directory of your MediaWiki installation.

If you are familiar with git and have shell access to your server, you can also obtain the extension as follows:

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

Installation[edit]

  • Download and place the file(s) in a directory called StickToThatLanguage in your extensions/ folder.
  • Add the following code at the bottom of your LocalSettings.php:
    require_once "$IP/extensions/StickToThatLanguage/StickToThatLanguage.php";
    
  • Configure as required
  • YesY Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

Configuration[edit]

This extension comes with some customization options:

$egSTTLanguageDisplaySelector
(boolean) Allows to define whether the language selector should be used or not.
Default: true
$egSTTLanguageTopLanguages
(array) preferred languages (displayed on top) for the language switcher for non-logged-in users. Logged-in users can choose their preferred languages, these will be used instead. By default this is set to the busiest languages on Wikipedia. These languages are not used as defaults for the preferred languages user option.
Default: array( 'en', 'de', 'fr', 'nl', 'it', 'pl', 'es', 'ru', 'ja', 'pt' ); (languages of Wikipedias with the most articles)

To Do[edit]

  • Making the user preference option for choosing the languages sortable