Skip to content

Stdlib: Locale class getDefault/getDisplayName + BCP-47 parsers (#6696) - #19524

Merged
PurHur merged 3 commits into
masterfrom
agent/issue-6696-intl-locale-class
Jul 16, 2026
Merged

PurHur merged 3 commits into
masterfrom
agent/issue-6696-intl-locale-class

Conversation

@PurHur

@PurHur PurHur commented Jul 16, 2026

Copy link
Copy Markdown
Owner

Summary

  • Advertise Locale / locale_get_default() / locale_set_default() without extension_loaded('intl') (Normalizer-style partial surface; grapheme/Collator stay gated).
  • Add OOP Locale::getPrimaryLanguage() / getRegion() / getScript() / getDisplayName() (English display-name fallback; ICU deferred to full ext/intl).
  • Update compliance/unit/maintainer repros; regenerate capability matrix + bootstrap inventory; spine-cover new Locale method files.

Closes #6696

php-src reference

  • ext/intl/locale/locale_class.c / locale_methods.c / locale.stub.php

Test plan

  • php bin/vm.php test/repro/maintainer_locale_get_default.php → ok: Locale
  • PHPT: locale_get_default.phpt, locale_class_methods.phpt, locale_gated.phpt
  • vendor/bin/phpunit --filter 'LocaleDefaultTest|IntlExtensionPolicyTest'
  • php script/bootstrap-inventory.php --check → OK 5092/5092
  • php script/check-selfhost-spine-coverage-sync.php → OK
  • make north-star5-verify-fast → OK

Repro transcript

class=y intl=n fn=y
default=en_US_POSIX
lang=en region=US script=Hans
display=English (United States)
TypeError on enum operand
ok: Locale

Made with Cursor

Expose Locale/locale_get_default without extension_loaded('intl'), matching
the Normalizer partial-surface pattern, and add OOP BCP-47 helpers with an
English getDisplayName fallback (ICU deferred).

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur

PurHur commented Jul 16, 2026

Copy link
Copy Markdown
Owner Author

Maintainer review (2026-07-16): merge blocked — GitHub reports CONFLICTING vs master (likely inventory/spine drift after a2c98b10c / #19523 SemArgs).

Please rebase onto current master, regenerate docs/bootstrap-inventory.md if needed (php script/bootstrap-inventory.php), re-run:

  • php bin/vm.php test/repro/maintainer_locale_get_default.php
  • php script/bootstrap-inventory.php --check
  • php script/check-selfhost-spine-coverage-sync.php

Will re-verify and merge once green + conflict-free. Closes #6696 looks correct on intent.

PurHur and others added 2 commits July 16, 2026 11:24
Resolve bootstrap-inventory drift by regenerating in Docker after taking
master's generated baseline.

Co-authored-by: Cursor <cursoragent@cursor.com>
Regenerate inventory/capability docs after merge.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit 38c7ba5 into master Jul 16, 2026
@PurHur
PurHur deleted the agent/issue-6696-intl-locale-class branch July 16, 2026 11:26
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.

Stdlib: Locale class — getDefault()/getDisplayName() ICU locale API missing (ext/intl/locale)

1 participant