Page MenuHomePhabricator

Support special page aliases, namespaces and magic word translations of MediaWiki core and extensions in Special:Translate
Open, HighPublic

Description

Translation of these non-prose parts of MediaWiki poses multiple challenges:

  • These parts are stores in large MessagesXX.php files
    • Parsing and modifying of PHP files is challenging and can pose security risks
    • Translate does not support well non-dedicated files, as it prefers to regenerate files from scratch during export
  • Due to backwards compatibility requirements, it should not be possible to remove existing translations without translation admin approval
  • Translate extension does not support well for non-prose data. Custom interface would have to be added with strict checks. The translation needs to be serialized to a string format for storage.
  • Translation of some items must be unique, while some items must allow identical translations. This should be configurable, or better yet, defined by developers.

To support these translations, the following steps needs to happen:

  • Move each part into dedicated JSON file (per language), with schema for the format
  • Implement file format support for these files in Translate
  • Implement message validators for the requirements (no removal of existing translations, no conflicting translations, correct syntax)
  • (optional) Implement custom non-textarea UI for these in Special:Translate
  • Review the existing aliasFile, magicFile etc. annotations as they are bound to be stale now
  • Augment message group creation code to read the existing aliasFile, magicFile etc. from the specifications and create appropriate message groups

Details

Reference
bz40707

Event Timeline

bzimport raised the priority of this task from to Lowest.Nov 22 2014, 12:56 AM
bzimport set Reference to bz40707.
bzimport added a subscriber: Unknown Object (MLST).

(In reply to comment #0)

it would also solve bug 40706 I suppose.

Plus the edge case mentioned on bug 40635 comment 11.

(In reply to comment #1)

Plus the edge case mentioned on bug 40635 comment 11.

When did we jump to the conclusion that preventing duplicate names is actually a bad thing?

(In reply to comment #2)

When did we jump to the conclusion that preventing duplicate names is actually
a bad thing?

We didn't, it was just a sidenote about the perceived problem.

Nikerabbit renamed this task from Ditch Special:AdvancedTranslate and have the special features act as normal message groups to Support special page aliases, namespaces and magic word translations in Special:Translate.Apr 20 2016, 10:25 AM
Nikerabbit raised the priority of this task from Lowest to High.
Nikerabbit updated the task description. (Show Details)
Nikerabbit removed a subscriber: wikibugs-l-list.
Nikerabbit renamed this task from Support special page aliases, namespaces and magic word translations in Special:Translate to Support special page aliases, namespaces and magic word translations of MediaWiki core and extensions in Special:Translate.Mar 25 2020, 10:31 AM
Nikerabbit updated the task description. (Show Details)
  • Due to backwards compatibility requirements, it should not be possible to remove existing translations

It should be safe and should be allowed (in order to ease reverting bad/vandal translations) to remove translations that have not been synced to Git yet. Maybe even those that have been synced but haven’t been deployed anywhere except for beta cluster, although this latter may be risky (what if the removal isn’t synced before the branch cut? what if someone downloaded the master code from Git and deployed on a third-party site, which is not recommended but possible? etc.).

without translation admin approval

I don’t know how frequently this will be needed (hopefully quite rarely), but maybe it should require a new user right, so that it can be assigned to another, less privileged user group that’s created specifically for this purpose, in case the exiting translation admins cannot handle all requests.