Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make country_code_to_region_code_map public #87

Conversation

peaceful-james
Copy link
Contributor

This can assist in building better phone HTML inputs.

Copy link
Member

@szymon-jez szymon-jez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see how this indeed can be useful for the described use case.

I have checked libphonenumber and it exposes this data publicly.

UPDATE: After reconsidering: this function should be then be made to show up in the documentation. I would also think to expose it through a different, already public, module.

@peaceful-james
Copy link
Contributor Author

expose it through a different, already public, module

I can do this (and the docs).
Which module would you recommend?

@szymon-jez
Copy link
Member

I can do this (and the docs).

Thanks, I appreciate that.

Which module would you recommend?

https://github.com/ex-phone-number/ex_phone_number/blob/v0.4.5/lib/ex_phone_number.ex

@peaceful-james
Copy link
Contributor Author

peaceful-james commented Nov 26, 2024

@szymon-jez Since my motivation for this was to afford building dropdowns for region selector for phone inputs, I think it would be good to add a function that gives us these options.

The reason for this is that we can build this options list at compile time.

What do you think?

UPDATE: Ignore that suggestion. Such a function should use Cldr.Territory and similar, which would bloat this library.

@peaceful-james
Copy link
Contributor Author

@szymon-jez It is ready for re-review

@szymon-jez szymon-jez self-requested a review November 26, 2024 14:51
@szymon-jez szymon-jez merged commit bd2d5bc into ex-phone-number:master Nov 27, 2024
10 checks passed
@peaceful-james peaceful-james deleted the make-country-code-to-region-code-map-public branch November 30, 2024 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants