Description

There's no way to make Moin aware of the title pattern used in translated system categories and templates. It is the user who needs to update page_category_regex and page_template_regex to match the adopted patterns to make Moin recognize them, and there's no documentation for that in the system pages setup. The solution is to make Moin a little bit smarter:

  1. Export the regexes to the po files. Translators ensure they match the actual page titles.
  2. When querying the regex value, if one is provided in wikiconfig.py, then that is used. If none is found, then the English regex is translated to request.cfg.language_default (note it is not request.lang). The regexes are not in wikiconfig.py (and other possible locations) by default anymore, and users of previous versions are encouraged to remove them too.

This way, Moin will rely on the translated regex by default. Only users wanting a different pattern for language_default would need to care about these regexes. Most users would not need to care about them anymore, and would not be affected by changes on the names of the system categories and templates. Note: except for current wikis using a non-default pattern, it would be even better to remove the ability to change these regexes at all (because normally users will accept default translation).

Steps to reproduce

  1. Make categories and templates translated to your language have a different pattern from Category* and *Template.

  2. Many Moin users probably are not using your new pattern in their regexes, so watch them getting annoyed because your new system categories and templates are not really categories and templates, just because they are not matching page_category_regex and page_template_regex.

Example

Category and template pages were recently translated to pt-br. Page title patterns changed from Category* and *Template, to Categoria* and TemplateDe*. When these pages get released, the user will probably have no idea of what has changed, so these pages likely won't be recognized as real categories and templates, which was the whole point of translating them.

Workaround

The user has to somehow be aware of the new patterns, then update his regexes with them, or rather ignore system categories and templates at all (making their translation pointless).

Discussion

We should handle multilang wiki somehow also. I understand hat it is not difficult (we can keep regexes rather difficult, so, for example, category regex in one lang doesn't be equal to template regex in another), but should be taken into account also. -- EugeneSyromyatnikov 2009-12-10 06:15:14

Plan


CategoryMoinMoinBug CategoryForMoin2

MoinMoin: MoinMoinBugs/ShouldTranslateCategoryAndTemplateRegexes (last edited 2010-03-07 21:32:55 by RenatoSilva)