Skip to content

Conversation

@amirrzea
Copy link

Add Iran (fa_IR) Locale Data

This pull request introduces comprehensive data for Iranian addresses, expanding the faker-cxx library's functionality to generate realistic location-based information for the fa_IR locale.


Changes Made

  • Added fa_IR Locale Data
    Implemented new data structures for the Iranian locale within location_data.h.

  • Cities & Provinces
    Added exhaustive lists of Iranian cities (iranCities) and provinces (iranStates).

  • Street Data
    Introduced arrays of common Iranian street names (iranStreetNames) and prefixes (خیابان, بلوار), aligned with Iranian naming conventions.

  • Address Composition Rules

    • Defined iranStreetFormats to enforce natural Iranian address patterns
    • Defined iranAddressFormats to include the پلاک label for building numbers, with optional واحد or طبقه secondary addresses.
  • Zip Codes
    Added 10-digit Iranian zip code format (##########).

  • Unit Tests

    • Registered Iran in location_test.cpp
    • Added shouldGenerateIranStreet and shouldRespectIranAddressComposition tests to validate cultural address logic and ensure compositions follow Iranian rules.

Why This Matters

This change directly addresses the need for accurate and culturally correct Iranian address generation. By encoding composition rules (e.g., میدان X، خیابان Y) and labels (پلاک, واحد, طبقه), generated addresses now reflect realistic Iranian formats instead of generic placeholders.

All related tests are passing, including both generic location tests and the new Iran-specific ones.

@amirrzea amirrzea marked this pull request as ready for review October 2, 2025 15:06
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