Page MenuHomePhabricator

Let banana check for trailing spaces (whitespace + newline) to improve translations from translatewiki.net
Closed, ResolvedPublic

Description

Some messages in en.json contains trailing spaces.

It is impossible to export trailing spaces from translatewiki.net as the used MediaWiki always trims the wikitext before save.

It would be nice when banana can check for this case. The space should be moved to the code instead.

See examples:
https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Genealogy/+/619519
https://gerrit.wikimedia.org/r/c/mediawiki/extensions/JSBreadCrumbs/+/619515

Details

Event Timeline

I would assume that for the programming part the issue is needed on github to track the addition and the release. Later the new release can be pushed with LibUp to all extensions.

But is there a consens needed from the developer community?

I do not want problems like T155182, where the process does not work together, but with a new version of banana there would be a new status quo pinned.

That is the reason why I created the task here. I would move it to github when no show stopper is given here.

Given that trailing whitespaces break the translatewiki.net-based translation process, this seems like a no-brainer that doesn't need much discussion.

Seems like it has already been added in wikimedia/banana-checker#89 (thanks @Jdforrester-WMF!) but defaults to allowTrailingWhitespace: true so needs either a change to the default, or the MediaWiki default should be updated.

Patch written. Once merged, I'll do another release and get LibUp to upgrade everything, but there's no 'fixer' system, so it'll just fail to update in non-compliant repos.

Change 921505 had a related patch set uploaded (by Jforrester; author: Jforrester):

[labs/libraryupgrader/config@master] Bump grunt-banana-checker to 0.11.0

https://gerrit.wikimedia.org/r/921505

Change 921505 merged by jenkins-bot:

[labs/libraryupgrader/config@master] Bump grunt-banana-checker to 0.11.0

https://gerrit.wikimedia.org/r/921505