Extension:TranslatedPages

From MediaWiki.org
Jump to navigation Jump to search
MediaWiki extensions manual
OOjs UI icon advanced.svg
TranslatedPages
Release status: unmaintained
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 Affero General Public License 3.0 or later
Download https://notabug.org/ovruni/mediawiki-translatedpages
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.

Usage[edit]

Synchronize translations[edit]

  • 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:
      Example from screen to define page base
  • 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:
      Example from screen to define translated page
      • Where $num is the corresponding revision number of the base Page (revision numbers appear in the page history).
        Example:
        Version number in history page
    • You can add the parameter outdated on the translated page to place a warning.
      Example:
      Example of the "outdated" warning

Menu[edit]

  • 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.
Version number in history page

Show Status[edit]

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

Download instructions[edit]

The source code can be downloaded via git:

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

Installation[edit]

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 parameters[edit]

  • 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');

See also[edit]