The names of special pages historically have been translated using a PHP file. Its proposed that we move to a translatewiki-based approach using JSON files.
The current setup poses problems for code maintainers as engineers are often merging code that contains translated strings of languages they do not understand and translators are required to understand basic PHP syntax. In addition to this, these files do not enjoy the same extent of translation that the translatewiki-based translations do. For example, the Special:Nearby page has 45 translations in alias file, whereas the exact same string inside the i18n folder for mobile-frontend-nearby-title message enjoys 148 unique translations via translatewiki. Let’s pay off this technical debt and improve translations for our projects.
Current Implementation
Added a new configuration parameter: TranslationAliasesDirs that takes a directory as input. The directory is expected to have per language JSON files containing special page aliases. Example:
{ "SpecialPageAliases": { "NotifyTranslators": [ "إخطار_المترجمين" ], "TranslatorSignup": [ "اشتراك_المستخدمين" ] }
The TranslationAliasesDirs can be defined in extension.json:
... "TranslationAliasesDirs": { "TranslationNotificationsAlias": "i18n/aliases/" }, ...
We've added a maintenance script (ConvertExtensionsMessagesToTranslationAlias) that can convert existing ExtensionMessagesFiles to individual per language JSON files in the format accepted by TranslationAliasesDirs
Relevant patches:
- https://gerrit.wikimedia.org/r/c/mediawiki/core/+/977085 - Patch in core that adds the TranslationAliasesDirs and the ConvertExtensionsMessagesToTranslationAlias maintenance script.
- https://gerrit.wikimedia.org/r/c/mediawiki/extensions/TranslationNotifications/+/977084 - Patch in TranslationNotifications extension to use TranslationAliasesDirs configuration parameter.