Page MenuHomePhabricator

Expose toNFKC() and toNFKD() in Scribunto mw.ustring library
Closed, ResolvedPublic

Description

Expose toNFKC() and toNFKD() in Scribunto mw.ustring library.

We already expose toNFC() and toNFD() from UtfNormal\Validator, so exposing the former two which are defined there as well, is trivial.

Event Timeline

Danny_B created this task.Feb 10 2016, 9:03 AM
Danny_B raised the priority of this task from to Normal.
Danny_B updated the task description. (Show Details)
Danny_B added a subscriber: Danny_B.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptFeb 10 2016, 9:03 AM
Anomie added a subscriber: Anomie.Feb 10 2016, 6:02 PM

Note this would also need pure-Lua implementations of the two methods, so it's not likely to be quite as trivial as you think.

Anomie lowered the priority of this task from Normal to Low.Feb 10 2016, 6:03 PM
Anomie set Security to None.

Note this would also need pure-Lua implementations of the two methods, so it's not likely to be quite as trivial as you think.

OK, where else than in UstringLibrary.php it appears then, please? I haven't noticed it thus I marked it good first bug assuming it would be pretty much just copypaste of the already existing sister methods.

OK, where else than in UstringLibrary.php it appears then, please?

engines/LuaCommon/lualib/ustring/ustring.lua, and implementing it will probably need modification of
engines/LuaCommon/lualib/ustring/make-normalization-table.php to generate another large file similar to engines/LuaCommon/lualib/ustring/normalization-data.lua.

And don't forget you'll need to add testing for the new functions to extensions/Scribunto/tests/engines/LuaCommon/UstringLibraryTest.php and tests/engines/LuaCommon/UstringLibraryNormalizationTests.lua.

Change 280864 had a related patch set uploaded (by Anomie):
Add toNFKC and toNFKD to mw.ustring

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

Change 280864 merged by jenkins-bot:
Add toNFKC and toNFKD to mw.ustring

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

Dereckson added a subscriber: Dereckson.EditedApr 2 2016, 3:28 PM

@Danny_B You mention on Gerrit you hope it will be deployed soon. This will reach in two weeks the Wikimedia sites Wednesday, 06 April 2016 the Wiktionary projects. Do you have a use case requiring it sooner?

Anomie closed this task as Resolved.Apr 2 2016, 3:45 PM
Anomie claimed this task.

This should be deployed with 1.27.0-wmf.20, see https://www.mediawiki.org/wiki/MediaWiki_1.27/Roadmap for the schedule.

Dereckson added a comment.EditedApr 2 2016, 5:53 PM

On IRC, Danny_B indicated the use case is a Wiktionary module, and furthermore confirmed it's okay to wait for the MediaWiki train. I fixed the date in my previous comment, it's indeed far less than two weeks.