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:

  1. The remote wiki uses a different InterWiki name

  2. For more help, see HelpOnEditing or HelpOnCreoleSyntax

  3. For more help, see HelpOnEditing or HelpOnMoinWikiSyntax

  4. XSLT option disabled, please look at HelpOnConfiguration

  5. is invalid. Please refer to HelpOnSearching

  6. Please set an interwikiname in your wikiconfig (see HelpOnConfiguration) to

  7. Refer to HelpOnSynchronisation for help

  8. exists and has the appropriate members in it. Use HomepageGroupsTemplate for

  9. NewPage(HomepageReadWritePageTemplate,read-write page,%(username)s)

  10. NewPage(HomepageReadPageTemplate,read-only page,%(username)s)

  11. NewPage(HomepagePrivatePageTemplate,private page,%(username)s)

  12. 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


CategoryMoinMoinBug

MoinMoin: MoinMoinBugs/ShouldAlwaysTranslateSystemPageTitles (last edited 2010-01-22 00:00:22 by RenatoSilva)