Skip to content

feat/ adds country field type detection with locale-based candidate#76

Open
Najma099 wants to merge 1 commit intoShantanugupta43:mainfrom
Najma099:feature/add-country-field
Open

feat/ adds country field type detection with locale-based candidate#76
Najma099 wants to merge 1 commit intoShantanugupta43:mainfrom
Najma099:feature/add-country-field

Conversation

@Najma099
Copy link
Copy Markdown

What

Adds country as a new form field type to FORM_FIELD_PATTERNS.

How

  • Matches fields with names/ids containing: country, country_code,
    nation, nationality, country_name
  • Detects the user's country locally from navigator.language
    (e.g. "en-IN" → "India") using Intl.DisplayNames
  • Uses try/catch consistent with the existing timezone block
    which uses the same Intl API
  • No API call needed — fully local detection

Example

User with navigator.language = "en-IN" focusing a name="country"
field will see "India" suggested with confidence 0.85

@Najma099 Najma099 changed the title feat: add country field type detection with locale-based candidate feat/ add country field type detection with locale-based candidate Apr 11, 2026
@Najma099 Najma099 changed the title feat/ add country field type detection with locale-based candidate feat/ adds country field type detection with locale-based candidate Apr 11, 2026
@Najma099
Copy link
Copy Markdown
Author

@Shantanugupta43 , can you please review the code and let me know if any changes are required?

@Shantanugupta43
Copy link
Copy Markdown
Owner

Yep will do give me few days apologies for the delay got few urgent responsibilities

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