Description
All code like _('Please see HelpOnEditing.') should be replaced with _('Please see %(pagetitle)s.') % {'pagetitle': _('HelpOnEditing') }. It would also be nice to have a script, e.g. a commit hook, that would look for these raw references in the code, and generate warnings. This new approach will avoid the extra work of looking up the right name of the page when translating the messages in the .po files, and will also centralize the title translation in one single place.
Steps to reproduce
Try to change a page title translation (e.g. msgid "HelpOnEditing") to a better name. You will have to either translate all the messages where it is mentioned, or keep all the raw references within the other messages untranslated. This last for example is the current approach in this translation.
Strings to replace
The following regexes can be used in a po file to detect strings with raw references to translatable system pages. Once detected, they need to be updated in the source code and the po file needs to be generated again.
References in the beginning of a string |
"(RecentChanges|TitleIndex|FindPage|etc)[^/A-Z].+" |
References in the middle or end |
".+(RecentChanges|TitleIndex|FindPage|etc).*" |
Non-msgid standalone references |
^"(RecentChanges|TitleIndex|FindPage|etc)" |
These regexes found the following string fragments in Moin 1.9.0:
The remote wiki uses a different InterWiki name
For more help, see HelpOnEditing or HelpOnCreoleSyntax
For more help, see HelpOnEditing or HelpOnMoinWikiSyntax
XSLT option disabled, please look at HelpOnConfiguration
is invalid. Please refer to HelpOnSearching
Please set an interwikiname in your wikiconfig (see HelpOnConfiguration) to
Refer to HelpOnSynchronisation for help
exists and has the appropriate members in it. Use HomepageGroupsTemplate for
NewPage(HomepageReadWritePageTemplate,read-write page,%(username)s)
NewPage(HomepageReadPageTemplate,read-only page,%(username)s)
NewPage(HomepagePrivatePageTemplate,private page,%(username)s)
terms and refer to HelpOnSearching for more information.%s
Discussion
RenatoSilva - Is it possible to write a commit hook which would even deny the commit if the changes would introduce these raw references?
Plan
- Priority:
- Assigned to:
- Status: