createStrings
createStrings(
locale?):Strings
Defined in: packages/core/src/i18n/strings.ts:161
The lookup for one document’s locale: table.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
locale? | unknown | the document’s locale: (v1 config.locale, v2 runtime.map.locale); anything that isn’t an object means “no overrides”. |
Returns
Section titled “Returns”a function from key (and placeholder values) to text. A key the table doesn’t set, or sets to something other than a non-empty string, falls back to English.
Example
Section titled “Example”const t = createStrings({ "maplibre-yaml.Legend.Title": "Leyenda" });t("maplibre-yaml.Legend.Title"); // "Leyenda"t("maplibre-yaml.Notice.More", { count: 3 }); // "…and 3 more (see the browser console)."