Page MenuHomePhabricator

Scale: translation of aliases
Open, LowPublic

Description

While the vast majority of Growth features will be translated via TranslateWiki, one outstanding element are page aliases, which are the strings that go in URLs for things like "Special:Homepage", etc. It would be nice, but not critical, if we had a solution to easily translate those.

This has been mentioned and discussed in comments like T246939#6014321 and T234846#5912192, and in the discussions below those comments.

Current state

Special page aliases can't be translated on translatewiki. Instead, a developer needs to change them directly in the codebase itself. Note that special page aliases are visible only in URL, in all other places, it's a message that's translated via TWN. With that in mind, it's not very visible. For that reason, I propose to ignore special page aliases in scaling, and just let it live its own life.

Things that currently can't scale:

  • Special:Homepage
  • Special:WelcomeSurvey
  • Special:Impact
  • Special:ClaimMentee
  • {{#mentor}}

Event Timeline

@Trizek-WMF @Tgr @Catrope @kostajh -- something I'm not clear on is how aliases usually get translated. For instance, "Special:Recent Changes" or "Special:Watchlist" -- how did those get translated for each wiki?

@Trizek-WMF @Tgr @Catrope @kostajh -- something I'm not clear on is how aliases usually get translated. For instance, "Special:Recent Changes" or "Special:Watchlist" -- how did those get translated for each wiki?

Change the alias files in the repo (for extensions). In core it's at https://github.com/wikimedia/mediawiki/blob/master/languages/messages/MessagesEn.php

You can't do it on translatewiki for a long time due to T109235: Re-enable Special:AdvancedTranslate on translatewiki.net

You can't do it on translatewiki for a long time due to T109235: Re-enable Special:AdvancedTranslate on translatewiki.net

You can do it on translatewiki, it will just have to be copied to the alias files manually. That's still a step up from community members doing the translation in random Phabricator comments, with no ability whatsoever to track completion.

You can't do it on translatewiki for a long time due to T109235: Re-enable Special:AdvancedTranslate on translatewiki.net

You can do it on translatewiki, it will just have to be copied to the alias files manually. That's still a step up from community members doing the translation in random Phabricator comments, with no ability whatsoever to track completion.

This is a very good idea. Would still require manual copy-pasta (or semiautomated with a script), but definitely an improvement.

You can't do it on translatewiki for a long time due to T109235: Re-enable Special:AdvancedTranslate on translatewiki.net

You can do it on translatewiki, it will just have to be copied to the alias files manually. That's still a step up from community members doing the translation in random Phabricator comments, with no ability whatsoever to track completion.

This is a very good idea. Would still require manual copy-pasta (or semiautomated with a script), but definitely an improvement.

@Urbanecm_WMF is there something actionable for this task (and if so could you update the description please), otherwise if there is nothing to do now could we move it out of our current sprint board?

@kostajh Yes, there is. I personally vote for implementing @Tgr's idea. I'll talk about it with Marshall later today, and will update this task according to what he says.

@kostajh -- @Urbanecm_WMF and I agreed that this is a low priority task for him, and so I am moving off the sprint board. But before we put it away for now, can you post your opinion on @Tgr's solution, so that when we pick the task up, it's ready to go?

@Trizek-WMF -- we've decided that new deployments will not be blocked on these aliases.

@kostajh -- @Urbanecm_WMF and I agreed that this is a low priority task for him, and so I am moving off the sprint board. But before we put it away for now, can you post your opinion on @Tgr's solution, so that when we pick the task up, it's ready to go?

@Tgr's idea sounds fine to me, as I understand it we would add strings to en.json/qqq.json with keys like "specialpage-homepage" and then would look in TranslateWiki.net for the translated results? We could probably write a generic script that could look at all the values and regenerate the PHP aliases file in our extension, so it's a less manual process for developers; we currently don't need that with our existing deployment process but if we want to mass-enable for all wikis at some point then a script could be useful.

It seems to me that translating aliases using the TranslateWiki.net is a bad idea. If we use these aliases in bots, then any user or vandal can break them all.

It seems to me that translating aliases using the TranslateWiki.net is a bad idea. If we use these aliases in bots, then any user or vandal can break them all.

@Iniquity do you mind writing out in more detail what problems you foresee with this approach? How would bots be using these aliases, and how would using translated strings from translatewiki.net be prone to vandalism in ways that other translated strings are not? Do you mean that someone might add an alias for specialpage-homepage as Special:Redirect/page/12345 for example?

I personally believe the risk of vandalism is comparable to other translations, which are done via translatewiki.net. Even when using a script to generate the canonical source of aliases (ie. https://github.com/wikimedia/mediawiki-extensions-GrowthExperiments/blob/master/GrowthExperiments.alias.php), merging changes there would still need require human oversight, decreasing the risk of obvious mistakes.

@Iniquity do you mind writing out in more detail what problems you foresee with this approach? How would bots be using these aliases, and how would using translated strings from translatewiki.net be prone to vandalism in ways that other translated strings are not? Do you mean that someone might add an alias for specialpage-homepage as Special:Redirect/page/12345 for example?

Yes, something like that. This is especially critical for a magic word that can be substituted.

I personally believe the risk of vandalism is comparable to other translations, which are done via translatewiki.net. Even when using a script to generate the canonical source of aliases (ie. https://github.com/wikimedia/mediawiki-extensions-GrowthExperiments/blob/master/GrowthExperiments.alias.php), merging changes there would still need require human oversight, decreasing the risk of obvious mistakes.

If after the translation of the aliases there is a manual approval, then I think this will solve the problem.