Skip to content

Add UAE (United Arab Emirates) localflavor support #527

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

samiashi
Copy link

@samiashi samiashi commented Jun 2, 2025

Add UAE (United Arab Emirates) localflavor support

This PR adds complete localflavor support for the United Arab Emirates (UAE).

Form Fields:

  • UAEEmiratesIDField - Validates 15-digit Emirates ID numbers in format 784-YYYY-NNNNNNN-N
  • UAEEmirateField - Choice field for selecting from 7 UAE Emirates with 2-letter codes
  • UAEEmirateSelect - Select widget with Emirates choices
  • UAEPostalCodeField - Handles UAE's lack of postal codes (accepts "00000" or empty values)
  • UAEPOBoxField - Validates P.O. Box numbers with flexible input formats
  • UAETaxRegistrationNumberField - Validates 15-digit VAT registration numbers

Model Fields:

  • Corresponding model fields for all form fields with appropriate max_lengths and validation

Additional Features:

  • Arabic translations for Emirates names and validation messages
  • Flexible input validation with automatic normalization
  • Complete documentation following project standards
  • Year-based validation for Emirates ID birth years

All Changes

  • Add an entry to the docs/changelog.rst describing the change.
  • Add an entry for your name in the docs/authors.rst file if it's not already there.

New Fields Only

  • Prefix the country code to all fields.
  • Field names should be easily understood by developers from the target localflavor country. This means that English translations are usually not the best name unless it's for something standard like postal code, tax / VAT ID etc.
  • Prefer 'PostalCodeField' for postal codes as it's international English; ZipCode is a term specific to the United States postal system.
  • Add meaningful tests. 100% test coverage is not required but all validation edge cases should be covered.
  • Add .. versionadded:: <next-version> comment markers to new localflavors.
  • Add documentation for all fields.

@samiashi samiashi force-pushed the add-uae-localflavor branch from 9afe412 to 8cd2d36 Compare June 2, 2025 13:41
samiashi added 2 commits June 3, 2025 18:24
- Emirates ID validation (784-YYYY-NNNNNNN-N format)
- 7 UAE Emirates with Arabic translations
- P.O. Box and VAT registration number validation
- 22 tests with 100% coverage
- Complete documentation
- Arabic i18n support
@samiashi samiashi force-pushed the add-uae-localflavor branch from 8cd2d36 to 233bdef Compare June 3, 2025 14:24
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.

1 participant