symfony/polyfill-intl-icu
Fallback implementations for PHP’s Intl ICU features when the intl extension isn’t installed. Provides limited “en” locale support for intl error functions plus Collator, NumberFormatter, Locale, IntlDateFormatter and IntlListFormatter.
App::setLocale(), Carbon) and frontend frameworks (Tailwind/Bootstrap for RTL). Polyfill’s locale_is_right_to_left() enables dynamic RTL/LTR UI adjustments without ext-intl.IntlListFormatter natively, reducing migration friction for ICU-dependent features.Collator, NumberFormatter) ensures backward compatibility while addressing missing intl extension scenarios.^1.34.0) with no code changes. Existing ICU APIs (e.g., new IntlDateFormatter()) continue to function, even without ext-intl.ext-intl is unavailable, eliminating runtime errors and reducing deployment complexity.rtl direction).Illuminate\Support\Facades\Lang for dynamic RTL content.intl (critical for bulk operations like search/sorting). Mitigation: Cache results or defer to ext-intl for high-traffic features.NumberFormatter/IntlDateFormatter may misrepresent non-English data (e.g., Thai dates). Mitigation: Restrict to English or use as a temporary solution.locale_is_right_to_left() in ar/he locales to ensure UI consistency (e.g., form alignment, text direction).Collator::compare() may fail with complex datasets (e.g., Arabic + Latin). Mitigation: Test with real-world content and plan for ext-intl upgrades.ext-intl will experience degraded functionality (e.g., incorrect pluralization, list patterns). Mitigation: Use only for English or as a stopgap.IntlListFormatter thoroughly on PHP 8.5.locale_is_right_to_left() in ar/he and validate frontend responses (e.g., Tailwind classes).IntlListFormatter used for localized lists (e.g., "A, B, and C")?Collator::compare() for search/filtering?ext-intl?intl extension upgrades if full i18n is required post-MVP.ext-intl?ext-intl for production once the polyfill is validated?locale_is_right_to_left() enables dynamic UI adjustments without ext-intl.IntlListFormatter.composer.json beyond the package update; autoloading handles integration automatically.composer require symfony/polyfill-intl-icu:^1.34.0
locale_is_right_to_left() in ar/he locales and adjust UI components (e.g., CSS classes, form alignment).IntlListFormatter for localized list patterns (e.g., "A, B, and C").Collator::compare() handles edge cases (e.g., mixed-script strings) and benchmark performance.IntlListFormatter for locale-aware lists in views/APIs (e.g., IntlListFormatter::format($items)).locale_is_right_to_left() to dynamic UI adjustments (e.g., rtl CSS classes in Blade templates).extension_loaded('intl') checks with runtime fallbacks (e.g., if (class_exists(IntlListFormatter::class))).IntlListFormatter.rtl classes), Bootstrap (RTL grid support), and Alpine.js for dynamic RTL toggling.App::setLocale()).IntlListFormatter.ar, he) with minimal UI adjustments.Collator::compare() for sorting in admin panels/search filters.NumberFormatter/IntlDateFormatter for English-only use cases.ext-intl upgrades in production environments.IntlListFormatter bugs in PHP 8.5). Update annually or as needed.extension_loaded('intl') checks) to prioritize ext-intl upgrades in high-traffic environments.Collator), but impact is mitigated by:
locale_is_right_to_left() results may break UI alignment. Mitigation: Validate in ar/he locales and add fallback logic.Collator::compare() may fail with complex datasets. Mitigation: Test with real-world content and log errors.IntlListFormatter in early PHP 8.5 releases. Mitigation: Test on PHP 8.5 and monitor Symfony’s releaseHow can I help you explore Laravel packages today?