rxaviers / cldrjs

Simple CLDR traverser

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Handle unicode variant subtags on likelySubtags and removeLikelySubtags

rxaviers opened this issue · comments

Since variant subtags are not being handled on likelySubtags, the minlanguageId of en-US-POSIX is wrongly en instead of en-POSIX leading to wrong bundle lookup. Similarly for maxLanguageId.

@rxaviers Any workarounds for this? I'm getting bitten by this issue since we're loading the full data set, and my en numbers aren't being formatted correctly. (Note: I am using the setAvailableBundles 'hack' as we've previously discussed.)

This is supposed to be an easy fix... Although, it will take me a while to work on it. Help appreciated. Basically, the files that need fix are likelySubtags and removeLikelySubtags (with special attention to the instruction of the lines I've highlighted). This may also help: subtags. Both likelySubtags and removeLikelySubtags are used in bundle loopup (root of the problem) and also in init.

Tests need to be included to assert this fix.

@patch, FYI this is fixed.

@rxaviers 🎉 Thanks! I’ll test this out.

Released in 0.4.4.