Skip to Content
🎲 Welcome to RandBox - Powerful JavaScript Random Data Generation Library! Learn More

locale

// usage randBox.locale() randBox.locale({region: true})

Generate a random ISO-639-1 language code

randBox.locale(); => 'ca'

Generate a random IETF region code

randBox.locale({region: true}); => 'es-EA'

Note, the language codes comes from the ISO-639-1 spec  and the region codes come from IETF standard