Repository navigation
fix(BJ): update Benin phone number to 10-digit format (post-Nov 2024 migration) - #778
Open
urooj-bits wants to merge 1 commit into
Open
urooj-bits wants to merge 1 commit into
urooj-bits wants to merge 1 commit into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #777
On 30 November 2024, Benin (+229) migrated all national fixed-line and mobile numbers from 8 digits to 10 digits by prepending
01to all existing numbers. TheBJentry indata.jsonstill carries the pre-migration 8-digit pattern, causing all current Benin numbers to failisValidPhoneNumberand be mis-parsed byparsePhoneNumber/formatPhoneNumber.Changes Made
BJ.regexfrom[24-689]\d{7}→01\d{8}(10-digit national format, all numbers now start with01)BJ.formatfromxx xx xx xx→xx xx xx xx xx(5 groups of 2 for 10 digits)Source: Google's libphonenumber
PhoneNumberMetadata.xml— the authoritative source documented ini18nify-data/phone-number/README.md. The BJ territory entry definesnationalNumberPatternas01\d{8}and format pattern as$1 $2 $3 $4 $5.Type of change
How Has This Been Tested?
Per the repro script in #777, after this change:
isValidPhoneNumber("+2290195123456", "BJ")→trueisValidPhoneNumber("0195123456", "BJ")→trueparsePhoneNumber("+2290195123456", "BJ")→ correctdialCode: "+229",phoneNumber: "0195123456",formattedPhoneNumber: "+229 01 95 12 34 56"Is your change backward compatible? Yes — the old 8-digit format is no longer issued in Benin's national plan.
Checklist
PhoneNumberMetadata.xml)