Page MenuHomePhabricator

Translate accepts <br/> in source files, yet it won't accept it in translations
Closed, ResolvedPublic

Description

  1. Open Manual:Upgrading at mediawiki.org and follow the "Translate this page" link for any language except English.
  2. Check unit #111. The English string contains a <br/> tag.
  3. Try to translate the string.

The extension keeps complaining about the <br/> tag and won't accept a translation with the tag in there - you can try and save the translation anyway, but the translated page won't be using the translated string. Of course if you don't use the tag, the result is mangled...

Feel free to reassign to a doc maintainer if you find one.

Event Timeline

tactica created this task.May 8 2016, 7:38 PM
Restricted Application added subscribers: Zppix, Aklapper. · View Herald TranscriptMay 8 2016, 7:38 PM

FWIW, this is not only about <br/>, it's about unmatched "special" chars in general. String #131 in the same file poses the same problem due to ")" being used to list a few items in a sentence.

Oh and while you're at it, try to translate string #140 without getting a broken numbered list.

Thanks for reporting this. What are the content of unit #111 and string #131 exactly? Could you document that in this Phabricator task?

This is unit #111:

# The existing installation should be detected. Follow the instructions on the screen to upgrade it.<br/>If asked for the "upgrade key", open your $localsettings file and look for the key assigned to $upgkey.

This is unit #131:

Long answer: It depends on a) how much you value your data, b) how hard it is to create a backup and c) how confident you are with MySQL maintenance and administration.

I'll note that you can use the <br /> in the translation even if the source has <br/>. I don't really understand why Translate is enforcing XHTML though.

Also if the translation unit is saved, either it shouldn't prevent the translation page from being updated or it should prevent the translation unit from being saved in the first place if the translation page is not going to be updated. This behavior needs to be changed imo.

FWIW, this is not only about <br/>, it's about unmatched "special" chars in general. String #131 in the same file poses the same problem due to ")" being used to list a few items in a sentence.

This has already been reported in T53226: There is an uneven amount of parenthesis: (): -1.

Change 287889 had a related patch set uploaded (by Glaisher):
braceBalanceCheck/XhtmlCheck: do not show warning if definition contains

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

Change 287889 merged by jenkins-bot:
braceBalanceCheck/XhtmlCheck: do not add warning if same as definition

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

Nikerabbit closed this task as Resolved.May 11 2016, 6:46 AM
Nikerabbit claimed this task.
Nikerabbit reassigned this task from Nikerabbit to Glaisher.
Nikerabbit edited projects, added Language-Q4-2016-Sprint 2; removed Patch-For-Review.
Nikerabbit moved this task from Backlog to Done on the Language-Q4-2016-Sprint 2 board.
Nikerabbit added a subscriber: Nikerabbit.