The locales from the user's environment
The locales translated by the app
Optional
options: PreferredLocaleOptions = {}Options for the function
An array of locales that are in both
import { availableLocales } from 'preferred-locale'
availableLocales(['en-US', 'fr-FR'], ['en-US', 'fr-FR', 'de-DE', 'az-Cyrl-AZ']) // ['en-US', 'fr-FR']
availableLocales(['en-GB', 'fr-FR'], ['en-US', 'fr-FR']) // ['en-US', 'fr-FR']
availableLocales(['es-MX'], ['es-ES'], {
regionLowerCase: true
}) // ['es-es']
Gets locales that are in both the user's environment and the app translations