Zum Hauptinhalt springen

Intl.Locale

Inoffizielle Beta-Übersetzung

Diese Seite wurde von PageTurner AI übersetzt (Beta). Nicht offiziell vom Projekt unterstützt. Fehler gefunden? Problem melden →

Eine spezifikationskonforme Polyfill/Ponyfill-Implementierung für Intl.Locale, getestet durch den offiziellen ECMAScript-Konformitätstest-Suite

npm Version size

Installation

npm i @formatjs/intl-locale

Anforderungen

Verwendung

Über polyfill-fastly.io

Sie können den polyfill-fastly.io URL Builder verwenden, um ein Polyfill-Script-Tag für Intl.Locale zu erstellen. Beispiel:

<!-- Polyfill Intl.Locale & its dependencies -->
<script src="https://polyfill-fastly.io/v3/polyfill.min.js?features=Intl.Locale"></script>

Einfach

import '@formatjs/intl-locale/polyfill'

Dynamischer Import + Funktionserkennung

import {shouldPolyfill} from '@formatjs/intl-locale/should-polyfill'
async function polyfill() {
// This platform already supports Intl.Locale
if (shouldPolyfill()) {
await import('@formatjs/intl-locale/polyfill')
}
// Alternatively, force the polyfill regardless of support
await import('@formatjs/intl-locale/polyfill-force')
}

Tests

Diese Bibliothek ist test262-konform.