Page MenuHomePhabricator

Translation: <tvar> should accept multi-line content
Closed, ResolvedPublic


Currently, the extension uses this regex:

	$re = '~<tvar\|([^>]+)>(.*?)</>~u';

when parsing the content of "tvar"[1], but this does not work if the content spans multiple lines, as in

I believe it would work if we set PCRE_DOTALL for this regex (if that is the case, this is an easy bug to fix, so I'm adding the appropriated keyword to the bug report).


Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 3:26 AM
bzimport set Reference to bz68451.
bzimport added a subscriber: Unknown Object (MLST).

PCRE_DOTALL is the suffix 's'.

Please add a test case if submitting a patch.

He7d3r set Security to None.

Change 406421 had a related patch set uploaded (by D3r1ck01; owner: Alangi Derick):
[mediawiki/extensions/Translate@master] Add support for multiple line in <tvar>

xSavitar subscribed.

@Nikerabbit, have a look at the patch if it's okay! Thanks.

xSavitar raised the priority of this task from Low to Medium.Feb 19 2018, 7:42 PM

As I'm working on it currently! :)

Change 406421 merged by jenkins-bot:
[mediawiki/extensions/Translate@master] Add multi-line content for <tvar> & its unit tests

Thanks so much @Nikerabbit for reviewing this :). Marking as resolved :)

But please @D3r1ck01 how can someone determine if it has been resolved or not?
I'm still trying to get familiar with how we work around here

@Tamgue, usually, when a ticket is open and you're interested in working on it, try to see if the problem still exist by reproducing it. If it still exist, you can claim the task if you think you can do it and then fix the problem, then submit a patch. Members of the community will review your patch and if it's okay, it will be merged else you will need to improve on it until it's okay for merge. Then when you finish the task and it's merged, you or any other person can close the ticket on phabricator by marking it as resolved as it's completed.