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:
- Export the regexes to the po files. Translators ensure they match the actual page titles.
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
Make categories and templates translated to your language have a different pattern from Category* and *Template.
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.
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.
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).
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
RenatoSilva - Currently, even multi-language wikis (like moinmo.in itself) have templates and categories in just one language, likely English. Hence fixing this bug would not raise this problem as it already exists currently. However, I do agree it may be a good idea to support multiple patterns, the problem is for what languages. Maybe a new config like additional_languages = ['ru', 'pt-br'] or so could be introduced, so that you e.g. get both BugTemplate and TemplateDeBug recognized as real templates at the same time.
- Assigned to: