[[PageOutline(2-5,Contents,pullout)]] = Show translated versions of wiki page = == Description == 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 [[Image(translated_pages_1.0_sample_english.png)]] 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 [report:9?COMPONENT=TranslatedPagesMacro here]. If you have any issues, create a [http://trac-hacks.org/newticket?component=TranslatedPagesMacro&owner=stoecker new ticket]. == Get the Plugin == See the [wiki:TracPlugins#Requirements Trac plugin requirements] for instructions on installing `setuptools`. `Setuptools` includes the `easy_install` application which you can use to install the TranslatedPagesMacro: {{{ #!sh easy_install TranslatedPagesMacro }}} You can also obtain the code from the Trac Subversion repository: {{{ #!sh svn co http://trac-hacks.org/svn/translatedpagesmacro }}} or download [download:translatedpagesmacro zipped source]. See TracPlugins for instructions on building and installing plugins. You can [source:translatedpagesmacro browse the source in Trac]. ''[http://trac-hacks.org/svn/translatedpagesmacro/0.11/#egg=TranslatedPages-dev 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/}}}. The new version has {{{:page}}} as default which is used more often for wikis. For existing installations using the old schema following settings must be used: {{{ #!ini [translatedpages] template = {page}/{lang} regexp = ([a-z]{2}) }}} Also the layout of the language specification page changed (more entries required tables style design). == Example == An example of the required language specification page can be found at [wiki: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: [[Image(translated_pages_1.0_sample_english.png)]] And in Zh_CN:WikiStart will generate: [[Image(translated_pages_1.0_sample_chinese.png)]] When translated page is outdated, Es:WikiStart will generate: [[Image(translated_pages_1.0_sample_espanol_update.png)]] An example of an actively used installation can be found at [http://josm.openstreetmap.de/wiki/Translations]. == 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 [TranslatedPagesMacro/TracLanguages TracLanguages]) (generally location is wiki/TracLanguages, content can copy from [TranslatedPagesMacro/TracLanguages TracLanguages]. page will show normal table what's different with [TranslatedPagesMacro/TracLanguages TracLanguages]) must provide the language codes as a table with following entries: {{{ |||||||||| }}} 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=''' 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=''' 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=''' 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. == Troubleshooting == 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 [TranslatedPagesMacro/TracLanguages 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 == [[TicketQuery(component=TranslatedPagesMacro,status=!closed)]] == Recent Changes == [[ChangeLog(translatedpagesmacro, 3)]] == Author/Contributors == '''Author:''' [wiki:ftofficer] [[BR]] '''Maintainer:''' [wiki:stoecker Dirk Stöcker] [[BR]] '''Contributors:''' [wiki:dottedmag]