wiki:TranslatedPagesMacro

Version 1 (modified by Zhang Cong, 15 years ago) (diff)

New hack TranslatedPagesMacro, created by ftofficer

TranslatedPages Macro - Show translated versions of a page.

Description

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 OriginalWiki/language_code format (language_code follows ISO 639.2 Alpha-2 format). The [[TranslatedPages]] macro generates a list of languages like

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.

Download

Download the zipped source from [download:translatedpagesmacro here].

Source

You can check out TranslatedPagesMacro from here using Subversion, or browse the source with Trac.

Example

Drop the attached TranslatedPages.py to <trac environment>/plugins.

For example, the page WikiStart was translated to Chinese version WikiStart/zh, Russian version WikiStart/ru and Spanish version WikiStart/es. Insert [[TranslatedPages]] to WikiStart will generate the following list:

And in WikiStart/zh will generate:

Recent Changes

18588 by stoecker on 2023-11-08 17:40:31
TranslatedPagesMacro: handle totally empty pages
18584 by stoecker on 2023-11-04 20:10:14
automated 2to3 conversion
17677 by stoecker on 2020-02-14 07:19:42
fix default for empty code spec
(more)

Author/Contributors

Author: ftofficer
Contributors:

Attachments (5)

Download all attachments as: .zip