Page MenuHomePhabricator

Better handling of lists
Open, Needs TriagePublicFeature

Description

Currently, to translate a list, you can either do

<translate>
<!--T:1-->
* Foo
* Bar
* Baz
</translate>

and translate it as a group, including the list syntax, or

* <translate><!--T:1--> Foo</translate>
* <translate><!--T:2--> Bar</translate>
* <translate><!--T:3--> Baz</translate>

to translate the items individually, without the list syntax.

There should be a way to easily split a list into different translation units without needing to use <translate></translate> tags around each unit individually, and without breaking the html output of the list markup. Something like

<translate>
<!--T:1-->
* Foo
* Bar
<!--T:2-->
* Baz
</translate>

that results in translation unit 1 with

Foo
Bar

and translation unit 2 with
Baz
and with the list output working regularly

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Nikerabbit changed the subtype of this task from "Task" to "Feature Request".

Probably the simplest way would be to have the same effect as

* <translate><!--T:1--> Foo</translate>
* <translate><!--T:2--> Bar</translate>
* <translate><!--T:3--> Baz</translate>

but done automatically:

<translate>
* <!--T:1--> Foo
* <!--T:2--> Bar
* <!--T:3--> Baz
</translate>

That would mean doing three things: always create a new unit when a line starts with list markup (like is currently done for \n\n), always treating them as inline, and removing list markup from the beginning of those units. That would certainly be possible to implement with a bit of work, and I would find it quite useful.

The difficult thing would be figuring out how to make the UX work. There are some situations where it might be useful to not split a list. And translation administrators wouldn't want to always have to split existing lists if they re-tag a page. That means at least adding a new <translate> tag attribute and probably a syntax version too unless the attribute was opt-in instead of opt-out (like nowrap).