Page MenuHomePhabricator

Extend page translation syntax by adding instruction to disable wrapping
Closed, ResolvedPublic

Description

Per the parent task, we need a syntax like <translate nowrap>...</translate> to prevent wrapping in places where it would break things.

Affected documentation

QA plan

Affected projects: All Wikimedia projects using Translate
Pre (or post)-deployment testing: Try marking translatable pages with regular and new nowrap sections. Translate them, update source to make them fuzzy. Check translation pages that nowrap sections are not marked as outdated, but regular sections are. This will be easier to test when other tasks of the parent tasks are resolved, because then untranslated sections are wrapped too.

Outcome

New syntax <translate nowrap>...</translate> can be used on translatable pages to prevent wrapping of section text inside html tags. Currently this only affects marking of outdated sections, but in future it will also affect any other kind of wrapping.

Event Timeline

Change 608324 had a related patch set uploaded (by Nikerabbit; owner: Nikerabbit):
[mediawiki/extensions/Translate@master] Implement <translate nowrap>

https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Translate/ /608324

Change 608324 merged by jenkins-bot:
[mediawiki/extensions/Translate@master] Implement <translate nowrap>

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

I think it should be stressed in the documentation that this boolean parameter is different from other boolean parameters in wiki code—HTML5 allows a boolean parameter named nowrap specified as either <translate nowrap> or <translate nowrap="nowrap">, while in the MediaWiki world generally any other value like <translate nowrap="1"> or <translate nowrap="lorem ipsum"> is accepted. (I’m not asking to change the current situation; it’s not that surprising since everything is a bit different in Translate, like !!FUZZY!! interpreted non-literally, <tvar|1> having a quite strange format etc. But people should be aware of this difference.)

Added to https://meta.wikimedia.org/wiki/Tech/News/2020/29 – if anyone's got a better idea for how to explain wrapping in a short and simple way, please edit.

Tested this on Mediawiki and it works well. Will leave it open for a couple of more days before marking this as resolved.

Moving to Review for review of added documentation.

abi_ moved this task from In Review to Done on the Language-Team (Language-2020-July-September) board.

I've reviewed the updated documentation. Marking this as done.