Version 15 (modified by Dirk Stöcker, 6 years ago) (diff)

Update example

Show translated versions of wiki page


A macro to output a list of translated versions of in current page. The English 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.

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 ofthen 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 (note that this wiki installation does not yet display the table heads correctly).

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

Known Issues

Display english page prominently in missing page overview

Recent Changes

16652 by rjollos on 2017-06-08 05:47:52
TranslatedPages 1.0.3: Warn when macro is used outside wiki realm

Fixes #13203.

16340 by rjollos on 2017-03-17 08:43:48
1.0.2: Remove unused method
16339 by rjollos on 2017-03-17 08:40:40
1.0.2: Don't log warning for line with whitespace or newline


Author: ftofficer
Maintainer: ftofficer
Contributors: dottedmag, stoecker

Attachments (5)

Download all attachments as: .zip