Aller au contenu principal

Intl.LocaleMatcher

Traduction Bêta Non Officielle

Cette page a été traduite par PageTurner AI (bêta). Non approuvée officiellement par le projet. Vous avez trouvé une erreur ? Signaler un problème →

Un ponyfill conforme aux spécifications pour Intl.LocaleMatcher. Comme cette proposition n'est qu'au stage 1, ce package est un ponyfill plutôt qu'un polyfill.

npm Version size

Installation

npm i @formatjs/intl-localematcher

Prérequis

Utilisation

Exemple simple

import {match} from '@formatjs/intl-localematcher'

match(['fr-XX', 'en'], ['fr', 'en'], 'en') // 'fr'

match(['zh'], ['fr', 'en'], 'en') // 'en'