Open main menu

Extension:TranslatedPages

MediaWiki extensions manual
OOjs UI icon advanced.svg
TranslatedPages
Release status: experimental
Implementation Parser function
Description Show the translated pages list
Author(s) Omar Vega Ramos (ovrunitalk)
Latest version 0.1.0
MediaWiki 1.18+
License GNU AGPL v3 or later
Download https://notabug.org/ovruni/mediawiki-translatedpages
Translate the TranslatedPages extension if it is available at translatewiki.net
Check usage and version matrix.

What can this extension do?Edit

This extension allows to synchronize translation pages, using a base page that can be in English or in another language.

UsageEdit

Synchronize translationsEdit

  • Create the page source. For example: Page
    • To define a base page, add the following code at the beginning of the first line: {{#TranslatedPages:}}
      Example:
  • Create the page to be translated into another language by following this format: $lang:Page , where $lang is the language code according to ISO 639 and with initial capital letters. For example: Es:Page, Fr:Page, etc.
    • To synchronize with any version of the page base, place the following code at the beginning of the first line: {{#TranslatedPages:revision=$num}}
      Example:
      • Where $num is the corresponding revision number of the base Page (revision numbers appear in the page history).
        Example:
    • You can add the parameter outdated on the translated page to place a warning.
      Example:

MenuEdit

  • The menu with the list of available pages in another language for any page can be displayed in two ways: either in the sidebar or the top bar.
  • The difference will be shown in the menu when the pages are not synchronized. The number on the right is the version of the page base, the number on the left is $num.

Show StatusEdit

  • To see the status table of translated pages (those that include {{#TranslatedPages:}}) should use the following code: {{#TranslatedPages:showstatus}} in any page.

Download instructionsEdit

The updated source code can be downloaded via git:

$ git clone git://gitorious.org/ovruni/mediawiki-translatedpages.git

Please copy and paste the code found below and place it in $IP/extensions/ExtensionName/ExtensionName.php. Note: $IP stands for the root directory of your MediaWiki installation, the same directory that holds LocalSettings.php.

InstallationEdit

To install this extension, add the following to LocalSettings.php:

#add configuration parameters here
#setup user rights here
require_once("$IP/extensions/TranslatedPages/TranslatedPages.php");

Configuration parametersEdit

TranslatedPages.phpEdit

  • Choose language base of articles, e.g. 'en', 'es', etc.:
$wgTranslatedPagesSourceLanguage = 'en';
  • Choose location of the languages bar, e.g. 'sidebar', 'topbar':
$wgTranslatedPagesLanguagesBar = 'sidebar';
  • Choose status colors:
$wgTranslatedPagesColorsStates = array('error' => '#FF0000', 'outdated' => '#FFFF00', 'updated' => '#008000', 'missing' => '#808080');

User rightsEdit

See alsoEdit