Page MenuHomePhabricator

{{ucfirst:$1}} have different capitalization in PHP and in JavaScript
Open, Needs TriagePublic

Description

The message uploadnologintext in hu contains an ucfirst:

{{UCFIRST:$1}} fájlok feltöltéséhez.

In PHP the upper case of "ß" is "ß":

> print wfMessage( 'uploadnologintext', 'ß' )->text()
ß fájlok feltöltéséhez.

In JavaScript the upper case of "ß" is "SS":

> mw.message( 'uploadnologintext', 'ß' ).text()
"SS fájlok feltöltéséhez."

The ucfirst in mediawiki.jqueryMsg should use the upper case function from mediawiki.Title which already uses the same capitalization like in PHP:

> new mw.Title( 'ß' ).getMain()
"ß"

Event Timeline

If I am reading the intent of T292552: Rename articles and users to update our case mapping to PHP 7.4 and Unicode 11 right, PHP will and must instead go the other way.

No, we'll have a permanent override for Georgian and the eszett character. We're not going to completely break kawiki just because Unicode told us to. {{ucfirst:}} is an attempt to implement title case, and as such, shouldn't map Georgian Mtavruli and probably shouldn't map Eszett. The other ligatures (apart from eszett) are also broken, e.g. fi should really become Fi not FI.

The ucfirst in mediawiki.jqueryMsg should use the upper case function from mediawiki.Title which already uses the same capitalization like in PHP

Sharing code with mediawiki.Title sounds like a good idea to me. The PHP override list is configurable, which is awkward, but whatever the solution ends up being, it will be easier with a single JS implementation.

@Fomafix: Removing task assignee as this open task has been assigned for more than two years - see the email sent to all task assignees on 2024-04-15.
Please assign this task to yourself again if you still realistically [plan to] work on this task - it would be welcome! :)
If this task has been resolved in the meantime, or should not be worked on by anybody ("declined"), please update its task status via "Add Action… 🡒 Change Status".
Also see https://www.mediawiki.org/wiki/Bug_management/Assignee_cleanup for tips how to best manage your individual work in Phabricator. Thanks!