Skip to content

Add gl_ES (Galician) locale - #1072

Open
apeleteiro wants to merge 1 commit into
FakerPHP:2.0from
apeleteiro:feature/gl_ES-provider
Open

apeleteiro wants to merge 1 commit into
FakerPHP:2.0from
apeleteiro:feature/gl_ES-provider

Conversation

@apeleteiro

@apeleteiro apeleteiro commented Sep 24, 2026 •

Copy link
Copy Markdown

What is the reason for this PR?

  • A new feature
  • Fixed an issue (resolve #ID)

Author's checklist

Summary of changes

Adds a new gl_ES locale for the Galician language (Galicia, Spain).

New providers in src/Provider/gl_ES/:

  • Person: first names common in Galicia, mixing Spanish forms (Manuel, María, Josefa…) and traditional Galician forms (Xoán, Brais, Uxía, Sabela…), plus frequent Galician surnames. Names use two surnames, as is usual in Spain. Titles are Sr./D./Dr. and Sra./D.ª/Dra.. dni() reuses the es_ES algorithm; licenceCode() returns Spanish driving licence classes.
  • Address: official Galician names of Galician municipalities (concellos), Galician street types (Rúa, Praza, Camiño, Rolda…), postcodes restricted to the four Galician provinces (15, 27, 32, 36), state() returning A Coruña/Lugo/Ourense/Pontevedra, and country names in Galician.
  • PhoneNumber: extends es_ES\PhoneNumber, with landlines restricted to the Galician prefixes 981, 982, 986 and 988.
  • Company: Galician company name formats (e instead of y, e Fillos), typical prefixes (Conservas, Adegas, Obradoiro…) and suffixes (S.L., S.A., S.Coop.Galega).
  • Internet: common email providers in Galicia and the .gal TLD.
  • Payment: extends es_ES\Payment (Spanish IBAN and CIF).
  • Color: colour names in Galician.

Tests added in test/Provider/gl_ES/ for Person (DNI check letter, licence code, name format), Address (postcode, province, single-line address) and PhoneNumber (Galician prefix).

Documentation PR: FakerPHP/fakerphp.github.io#133

Review checklist

  • All checks have passed
  • Changes are added to the CHANGELOG.md
  • Changes are approved by maintainer

{
yield new Address($this->faker);

yield new Person($this->faker);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This is not mistake? For Address test needed Person information?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

It's intentional: gl_ES\Address::$streetNameFormats uses {{firstName}} and {{lastName}}, which are provided by the Person provider. Without it, address() throws InvalidArgumentException: Unknown format "firstName", so testAddressIsSingleLine() needs it. pt_PT\AddressTest does the same for the same reason.

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