Localization - The Translation Portal

This group is intended as a resource for translators - to share tips and tricks how to create and maintain a localized version of PmWiki:

  • Translate the strings which PmWiki uses in your local language
  • Prepare a local version of PmWiki's documentation pages

The installation, configuration and usage of other language(s) support, is documented separately in PmWiki.Internationalizations (Part of the distribution while this group Localization is not).

Language

Please, write here in English - don't worry about fixing spelling errors or typos :-).

First time translation

Start here when there is no translation for your language and you want to create one.

Before anything else, subscribe to the english mailing list. Pm (Patrick Michaud, the owner of PmWiki) will acknowledge your wish and give you some basic information. You can also ask for a localized mailing list if you have several volunteers working on your localization project.

Basically there are two steps involved in creating a local translation on pmwiki.org:

  1. create an XLPage in the appropriate PmWikiXx group (where "Xx" is the appropriate two-letter language code),
  2. create the "home page" for the group as PmWikiXx/PmWikiXx .

pmwiki.org tries to help out a bit by providing page templates for each of the above pages(XLPageTemplate and PmWiki.PmWiki). For example, if someone wanted to create a Māori translation (language code "mi"), they would fill in the pages at

  • PmWikiMi/XLPage?action=edit
  • PmWikiMi/PmWikiMi?action=edit

You will probably also want to include your language in the PmWiki.OtherLanguages page to have it listed appropriately on main PmWiki homepage and in other pages in the PmWiki group.

That's all that really *needs* to be done to provide a localization.

Completing a translation

However, if you want to go further, and provide translations of documentation or other files, then it's simply a matter of creating pages within the new group. As far as what pages should be translated, and how they should be translated -- I tend to leave those decisions up to whomever is doing the work of translating. :-) Pm

XLPage

Once i18n-Xx.zip file is installed (see this page for instructions), the PmWikiXx.XLPage is available from the wiki itself and can be used to translate or change the translated words without further server change. Any fix in this page is immediately visible on the wiki. Of course, Xx stands for your Langage code.

Templates

For Cookbook Recipe Authors

  • If your recipe uses text, use $[Your Text in English]
  • If you need a function to translate a specific phrase, use XL()
    • For example, XL("Your Text in English");
  • If you need to translate all the phrases inside something, use FmtPageName()
    • For example, FmtPageName("<div class='example'>$[Your Text in English]</div>", $pagename);

Resources

And the page which is distributed with the download, to explain PmWiki installers how to install the local version :

Example of localized pages structure

In French, for example, we have the following structure:

  • From the pmwiki home page we follow the (bottom of page) French link. This link goes to a French translation of the main page, with three additional links to translation-relevant pages.

Should the page titles be translated ?

Whether or not document page names are translated is up to the individual translator, e.g.:

  • the German translation mainly uses the english page names
  • the French translation uses translated page names, which need a careful follow-up of already translated page and page interlinks. Page titles have been later set back to english.

In any case, the title appearing to the user can be set by the directive (:title title of the page:), hiding the real page name (which is still visible in the address name).

A link feature available since version 2.1 helps with page interlinks; now titles can be displayed instead of the link name:

  • [[PageName|+]] displays the real page title and not 'PageName'. This means that anywhere you use the link to the english name, the title of the page is displayed instead of the page name. With that, if page names are not translated, the links no longer needs to be translated; it is only needed to give local titles to local pages. When writing or translating a page, simply add the |+ to any links and the translation is done.

Also pagelists in a given language can use the format 'title' which display a list with page titles (in local language) instead of page names. You can list all pages of a given translation with the following call:

  • [[PmWikiXx?action=search&q=PmWikiXx/&fmt=title]]

Starting with PmWiki version 2.2.14 (PITS:01157) the title of several technical pages is automatically translated, if the corresponding string is provided in the XLPage, without the need to add a (:title <PageTitle>:) directive in that page. Also the [[PageName|+]] markup supports this feature, to translate the link text automatically. This is especially helpful for those pages that initially do not exist, like RecentChanges. A separate section "PageTitle/LinkText technical pages" with some entries is added to the XLPageTemplate for this feature.
But note the priority order to take the PageTitle/LinkText:

  1. if available, taken from the (:title:) directive
  2. if available, taken from the XLPage entry
  3. otherwise just take the PageName

More specifically the following page names are included, including most default pages in the Site and SiteAdmin groups:

 (All)?(Site|Group)(Header|Footer|Attributes)
 (All)?Recent(Changes|Uploads)
 (Auth|Edit)Form
 (Block|Auth)List
 (Side|Left|Right)Bar
 (Wiki)?Sandbox
 \\w+QuickReference
 \\w+Templates
 ApprovedUrls
 AuthUser
 InterMap
 NotifyList
 PageActions
 Site(Admin)?

where "(...)?" means an optional part, "(a|b)" means "a or b", and "\\w+" means a number of letters.

So, considering everything, it is generally recommended to stick to the English page name, and use the above tools to hide this from users.

If adopted, you can then set in the page GroupFooter the following (which is not quite ok in this group but should work in your local language group):

%define=trad block color='#060' bgcolor=#cf9 border='1px solid #060' padding='3px' font-size='smaller'%

----
%trad% (:if exists PmWiki.{$Name}:)
Traduction of [[(https://www.pmwiki.org/wiki/)PmWiki.{$Name}]] -(:elseif exists Site.{$Name}:)
Traduction of [[(https://www.pmwiki.org/wiki/)Site.{$Name}]] - (:ifend:) Original page on [[(https://www.pmwiki.org/wiki/){$FullName}]] - [[$[Backlinks]->A?action=search&q=link={$FullName}&fmt=title]]\\
(:if (equal "{$ScriptUrl}" "https://pmwiki.org/wiki") or (equal "{$ScriptUrl}" "https://www.pmwiki.org/wiki"):)
Last modifications:\\
[[{$FullName}]]: {$LastModified}\\
(:if exists PmWiki.{$Name}:)
[[PmWiki.{$Name}]]: {PmWiki.{$Name}$LastModified}
(:ifend:)

Original page on Localization.Localization - Backlinks
Last modifications:
Localization.Localization: January 02, 2022, at 02:04 AM

If English names are maintained for the translated pages, you can then make a comparative list by creating a page 'ListLocal' and writing in it the following (replace PmWikiXx by your local group). Note that the pagelist directive must be placed on a single line: it has been divided onto multiple lines here for presentation reasons only:

 
(:pagelist fmt=PmWikiXx.ListLocal#translation group=PmWiki
 order=-time -RecentChanges -DocumentationGuidelines-Comments:)

[[#translation]]
(:if equal {<$Group}:)
(:table border='1' cellspacing='0' cellpadding='0':)
(:cellnr align=center colspan=2:)'''Original page `PmWiki'''
(:cell align=center colspan=2:)'''Translation `PmWikiXx'''
(:cellnr align=center:)Page name
(:cell align=center:)Last modified
(:cell align=center:)Last modified
(:cell align=center:)Page name
(:if:)
(:cellnr:)[[{=$FullName}|+]]
(:cell:){=$LastModified}
(:cell:){PmWikiXx.{=$Name}$LastModified}
(:cell:)[[PmWikiXx/{=$Name}|+]]
(:if equal {>$Group}:)
(:tableend:)
(:if:)
[[#translationend]]

As an example of the result PmWikiFr.ListLocal

Existing translations

Note: the page listing does not work for those language groups which use UTF-8 character encoding and use those characters in the pagenames.

 LanguagePmWiki2Pages
 EnglishPmWikiList
 ArabicPmWikiArList
 BulgarianPmWikiBg/PmWikiBgList
 CatalanPmWikiCaList
 CzechPmWikiCs/PmWikiCsList
 DanishPmWikiDaList
 GermanPmWikiDeList
 SpanishPmWikiEs/PmWikiEsList
 EstonianPmWikiEt/PmWikiEtList
 FrenchPmWikiFrList
 ItalianPmWikiIt/PmWikiItList
 DutchPmWikiNlList
 LithuanianPmWikiLtList
 NorwegianPmWikiNo/PmWikiNoList
 PolishPmWikiPl/PmWikiPlList
 PortuguesePmWikiPt/PmWikiPtList
 Brazilian
Portuguese
PmWikiPtBrList
 RomanianPmWikiRo/PmWikiRoList
 RussianPmWikiRu/PmWikiRuList
 ShqipPmWikiSq/PmWikiSqList
 SwedishPmWikiSv/PmWikiSvList
 SlovakPmWikiSk/PmWikiSkList
 SlovenianPmWikiSi/PmWikiSiList
 TurkishPmWikiTrList
 TaiwanPmWikiTw/PmWikiTwList
 VietnamesePmWikiVi/PmWikiViList
 ChinesePmWikiZhCn/PmWikiZhCnList
 ChinesePmWikiZhTw/PmWikiZhTwList

Check Localization of this group

  • xlpage-i18n
  • Locale

This page may have a talk page: Localization.Localization-Talk.