1.0.2 • Published 2 years ago
@ottatech/locations v1.0.2
@ottatech/locations
Location information shared across otta apps.
Provides:
regions
: a map of ISO-3166 alpha-2 codes and their English language namessubregions
: a map of ISO-3166 alpha-2 code to a map of CLDR subregions and their English language names.
Reference:
- https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
- https://unicode-org.github.io/cldr-staging/charts/latest/subdivisionNames/germanic.html
Usage
import { regions, subregions } from "@ottatech/locations";
const user = { region: 'US', subregion: 'USTX' };
const countryLabel = regions[user.region]; // United States
const subregionLabel = subregions[user.region][user.subregion]; // Texas