Skip to main content

Internationalization

The package preserves official BCN names and does not bundle translated toponyms. Applications translate presentation labels by stable code through featureLabel:

const englishLabels: Record<string, string> = {
"13": "Santiago Metropolitan Region",
"131": "Santiago Province",
"13101": "Santiago Commune",
};

<ChileMap
topology={topology}
featureLabel={(feature) => englishLabels[feature.code] ?? feature.name}
formatValue={(value) => value.toLocaleString("en")}
/>;

featureLabel controls the default tooltip heading and each SVG feature's accessible name. Callback objects retain the canonical feature.name, which keeps application data and locale changes independent from geometry.

Translate surrounding UI, including loading states, error messages, legend labels, and the map-level ariaLabel, in the application.