Version 29 (modified by Dirk Stöcker, 5 years ago) (diff)

Remove some unwanted links

Show translated versions of wiki page


A macro to output a list of translated versions of in current page. The base language page should use the wiki name without language code, and translated wiki pages use a configurable version including language code. The [[TranslatedPages]] macro generates a list of languages like

english example

to direct to translated versions of wiki pages.

Each translated page has the same macro, but containing the revision of the base page. When the revision of the base page is newer than the translated revision (someone updated English page), then below the language links in menu an new menu point appears showing the translated revisions and newest !one. When clicking on that link, the differences between that revision are displayed. These can then be used to update the translation. During updating the revision in the translated page needs to be increased to the newest !one and the additional links disappears.

Bugs/Feature Requests

Existing bugs and feature requests for TranslatedPagesMacro are here.

If you have any issues, create a new ticket.

Get the Plugin

See the Trac plugin requirements for instructions on installing setuptools. Setuptools includes the easy_install application which you can use to install the TranslatedPagesMacro:

easy_install TranslatedPagesMacro

You can also obtain the code from the Trac Subversion repository:

svn co

or download [download:translatedpagesmacro zipped source].

See TracPlugins for instructions on building and installing plugins.

You can browse the source in Trac.

This is a link for setuptools to find the SVN download

Upgrading from older version 0.3

The macro enhanced a lot since version 0.3. A major change is the layout of the pages. Version 0.3 hardcoded the format page/<lang>. The new version has <lang>:page as default which is used more often for wikis.

For existing installations using the old schema following settings must be used:

template = {page}/{lang}
regexp = ([a-z]{2})

Also the layout of the language specification page changed (more entries required tables style design).


An example of the required language specification page can be found at TranslatedPagesMacro/TracLanguages.

For example, the page WikiStart was translated to Chinese version Zh_CN:WikiStart, Russian version Ru:WikiStart and Spanish version Es:WikiStart. Insert [[TranslatedPages]] to WikiStart will generate the following list:

english example

And in Zh_CN:WikiStart will generate:

chinese example

When translated page is outdated, Es:WikiStart will generate:

espanol example with update

An example of an actively used installation can be found at

Macro help text

Following chapter contains the help text found at [WikiMacros#TranslatedPages-macro] on systems with macro installed.

Macro to show the translated pages list.

Simply calling that macro in a page adds a menu linking to all available translations of a page.

A language page (usually TracLanguages) (generally location is wiki/TracLanguages, content can copy from TracLanguages. page will show normal table what's different with TracLanguages) must provide the language codes as a table with following entries:

||<language code>||<language name>||<english name>||<description>|| 

The description contains the text displayed above language links in that language (usually a variant of 'Other languages'). A table title line starting with ||= is not parsed.

The Macro accepts arguments as well:

  • revision=<num> to specify the version of the base page when last translated, a negative revision indicates that a page needs updating in the status overview table
  • outdated=<text> mark the page as outdated with given comment
  • silent don't output empty chapter for show options when nothing is shown
  • showoutdated to show all pages, where revision does not match base revision
  • showmissing to show all pages, where translation is missing
  • showproblems to show all pages which have problems
  • showuntranslated to show all untranslated pages
  • showstatus to show !one big status table
  • lang=<code> to restrict output of show outdated, status or missing to a specific language

Additional descriptions and comments

  • The status table uses following colors (note status table may require a lot of calculation time depending on number of pages and languages).
    • Red: There is an error with this page (shown in error list)
    • Yellow: Page needs update
    • Green: Everything up-to-date
    • Grey: Page is missing
  • The outdated parameter is useful when a page is known to be outdated, but there is no time to fix it immediately. The page is marked yellow in the status table and the text argument is displayed on the page itself.
  • The macro also works without the revision parameter on the translated pages, but it is a very helpful tool to keep original and translations in sync.
  • When using the show... parameters, no translation message link box is created. You need to add another instance of the macro if you want to have these texts and the page links.


When you setup the macro and it does not work:

  • Check if the macro text is in the WikiMacros page as told above. If not installation is broken.
  • Check if TracLanguages pages is available and in correct format.
  • If you created pages with language code and macro inserted, adding [[TranslatedPages(showproblems)]] to any page and then previewing (no need to save) should tell you existing problems.

Known Issues

Display english page prominently in missing page overview

Recent Changes

17181 by stoecker on 2018-05-20 21:56:32
don't fail for unknown language codes
17083 by stoecker on 2018-03-28 18:28:54
fix URL encoding, shortening code
17081 by stoecker on 2018-03-24 22:28:10
unify code, fix HTML escaping


Author: ftofficer
Maintainer: Dirk Stöcker
Contributors: dottedmag

Attachments (5)

Download all attachments as: .zip