From e679bd2ffa280121c4a10f76d87d487a20504e91 Mon Sep 17 00:00:00 2001 From: Mark Date: Fri, 5 Jun 2026 17:03:54 +0200 Subject: [PATCH] perf(intl): lazy load catalog fallback --- packages/intl/src/Catalog/GenericCatalog.php | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/packages/intl/src/Catalog/GenericCatalog.php b/packages/intl/src/Catalog/GenericCatalog.php index 34aa05d1f7..0df1660f2d 100644 --- a/packages/intl/src/Catalog/GenericCatalog.php +++ b/packages/intl/src/Catalog/GenericCatalog.php @@ -21,14 +21,7 @@ public function has(Locale $locale, string $key): bool public function get(Locale $locale, string $key): ?string { - return Arr\get_by_key( - array: $this->catalog, - key: "{$locale->value}.{$key}", - default: Arr\get_by_key( - array: $this->catalog, - key: "{$locale->getLanguage()}.{$key}", - ), - ); + return Arr\get_by_key($this->catalog, "{$locale->value}.{$key}") ?? Arr\get_by_key($this->catalog, "{$locale->getLanguage()}.{$key}"); } public function add(Locale $locale, string $key, string $message): self