Page MenuHomePhabricator

Outdated translations should render using the tvars of their tp:transver rather than the current version
Open, LowPublicFeature

Description

(I have no idea if this is actually practical, just an idea)

Feature summary (what you would like to be able to do and where):
If a translation is outdated then any translation variables should be substituted based on the definitions in the tp:transver rather then the definitions in the latest version of the source text

Use case(s) (list the steps that you performed to discover that problem, and describe the actual underlying problem which you want to solve. Do not describe only a solution):

MediaWiki.org has a lot of pages where someone renamed tvars from string to digits, and then didn't properly update translations. (No, they shouldn't do this IMO, but I have no control over what others do). The result is broken pages that link to literal translation variables.

Benefits (why should this be implemented?):

Pages render less broken. I just fixed an instance of this in https://www.mediawiki.org/w/index.php?title=Translations:Wikimedia_Apps/34/ar&diff=prev&oldid=6603402, when some unrelated vandalism combined with T367934 brought it to my attention

Event Timeline

While it would be useful in many cases, it could be harmful in some case: namely, when a translation variable is variable – a number regularly updated on the original page, a date, a user name changed every now and then, and so on. In this case, using an old version would be counterproductive, since the variable was introduced to avoid having to update the translations. (While such updates shouldn’t fuzzy translations, they may become fuzzy for unrelated reasons.)

Maybe instead of using the value based on the tp:transver, simply the latest available value should be used? This would solve the mediawiki.org problem without using older values than necessary.

However, that would break pages when numeric translation variables are particularly carelessly introduced and get reverted: I changed $1 back to $link1 because when replacing $1 with the link target, Translate also replaced $1 in US$100 million. Now, if Translate would use the latest available version of the tvar, it would break that amount of money again – and forever.

Would "if a tvar doesn't exist in the current version but does in the tp:transver use the tp:transver's version" solve all possible use cases? I think in the money case it wouldn't break anything that wasn't already broken.

There's also the third pattern to consider where a tvar is changed from an internal link to a URL or vice versa. But that's technically indistinguishable from the changing numbers case, so will just have to fail I guess.