Page MenuHomePhabricator

Allow customization of floating/alignment of the babel box
Open, LowPublicFeature

Description

Almost all userboxes in all Wikimedia projects have a setting that allows them to change floating. To ensure the same behavior of userboxes on the page and the ability to arrange them in one place without unnecessary hacks and code, you need to add such a parameter to the extension. For example by implementing an extra parameter, such as {{#babel:xx|yy|align=left}} or {{#babel:xx|yy|float=no}}.

Babel creates two types of userboxes:

  • Normal, using a parameter plain=1: {{#babel:xx|yy|align=left|plain=1}}
  • Userbox in a wrapper {{#babel:xx|yy|align=left}}

Each of them is usually used separately, that is, in each of them it should be possible to configure the floating separately.

Event Timeline

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

Extra parameters for suppressing the header ("Babel user information"), footer ("Users by language") and the border of the box would be nice, too, by the way.

(In reply to Waldir from comment #1)

Extra parameters for suppressing the header ("Babel user information"),
footer ("Users by language") and the border of the box would be nice, too,
by the way.

That's bug 31309.

Change 332332 had a related patch set uploaded (by Georggi199):
Fixed 2 issues with Babel boxes and categorisation of language codes

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

In the interim, you can achieve most layouts through applying CSS styles to a wrapping <div>.

Example of horizontal alignment:

<div style="display: flex;">
  {{#babel:plain=1|en|fr|es}}
</div>

Change 332332 abandoned by Nikerabbit:

[mediawiki/extensions/Babel@master] Fixed 2 issues with Babel boxes and categorisation of language codes

Reason:

Old, stale patch

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

Aklapper changed the subtype of this task from "Task" to "Feature Request".Feb 4 2022, 11:13 AM
Aklapper removed a subscriber: wikibugs-l-list.
Pppery subscribed.

Will probably hold off submitting a patch until T327847: Rework babel template parameter handling to make more sense is resolved because adding more supported parameter types would make the current system's problems even worse.

Change 884518 had a related patch set uploaded (by Pppery; author: Pppery):

[mediawiki/extensions/Babel@master] Add |float= parameter to babel box

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

It was mentioned above that this can be handled by a wrapping babel in a div. What benefit is there to support this in the Babel itself?

It was mentioned above that this can be handled by a wrapping babel in a div. What benefit is there to support this in the Babel itself?

It was always in these templates before the switch to extension happened. This is such a commonly used construct that forcing the user to use a hack seems wrong to me.

I assume the template uses need to be manually migrated anyway, so why not migrate to more flexible solution that doesn't increase code complexity? It's not a hack, it was used for table of contents too.

It shouldn't be manual, it should be semi-automatic: T228598. Moreover, all userboxes in almost all projects have a align setting. Babel creates userboxes. And the problem with the lack of such a setting for Babel userboxes at one time gave me problems.

It is bad practice to create a UI element without the settings used in exactly the same UI elements.

As the patch author, I'm neutral in this dispute, and filed the patch primarily just because the bug existed, not because I particularly cared for the feature.

Change 884518 abandoned by Pppery:

[mediawiki/extensions/Babel@master] Add |float= parameter to babel box

Reason:

If adding support for this parameter correctly is going to be that complicated, then I'm starting to agree with Nikerabbit over on the Phabricator task that it's not worth doing.

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

Pppery removed Pppery as the assignee of this task.Feb 1 2023, 1:08 AM
Pppery unsubscribed.
Iniquity updated the task description. (Show Details)