locale

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

Generate a random ISO-639-1 language code

chance.locale();
=> 'ca'

Generate a random IETF region code

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

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