Page MenuHomePhabricator

Utils::bcp47 code needs to be ported
Closed, ResolvedPublic

Description

Utils::bcp47 still says 'Not yet ported'. This is required to setting the lang attribute on the <body> tag which is behind a PORT-FIXME for this reason.

Event Timeline

ssastry triaged this task as High priority.Oct 22 2019, 8:55 PM
ssastry created this task.

I think this was a function which is in core and was ported to JS?

So at the least check core for the PHP version and copy that over, but it might also be nice to add this to siteinfo some how so we can just use the version in core w/o code duplication.

Change 545864 had a related patch set uploaded (by Subramanya Sastry; owner: Subramanya Sastry):
[mediawiki/services/parsoid@master] Copy bcp47 code from Mediawiki's LanguageCode.php implementation

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

I think this was a function which is in core and was ported to JS?

Yes, that is what I copied over.

So at the least check core for the PHP version and copy that over, but it might also be nice to add this to siteinfo some how so we can just use the version in core w/o code duplication.

I just want to unblock work but that can be done post port.

Change 545864 merged by jenkins-bot:
[mediawiki/services/parsoid@master] Copy bcp47 code from Mediawiki's LanguageCode.php implementation

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