Skip to content

pantoken-root / renderers/svelte/src / registerLocalized

Fušla: registerLocalized() ​

registerLocalized(bundle, target?, options?): void

Eksperimentála

Registrera ovddas elementtat lokálaš giellan ja suunnegoddi.

Gávnná buot dássahit LocaleBundle váldit dahje njuolggad BCP47-taggi. Gos tagga leat ovdán, makeStrings ráhkadit vahkáidmaid beaivvi-álbmogiid návvu Intl.DateTimeFormat-gii ja buot muhtun girjjat vuelodat álgga inglês; gávnná bundle mii leat buoremus leat skuvlaššat.

Parametera ​

bundle ​

string | LocaleBundle

A LocaleBundle objekta, dahje BCP47-tag ("hu", "ar", …).

target? ​

ElementRegistry

Registrvuohta mii galgá definere (almmuhuvvo globalThis.customElements).

options? ​

Lávttu dál register()-bohcci (dás lea prefix, only).

prefix? ​

string | null

only? ​

readonly string[]

Gullii / Gávdnat ​

void

Example ​

ts
import { registerLocalized, hu } from "@pantoken/web-components";

registerLocalized(hu);
registerLocalized("ar"); // direction inferred from LOCALES
registerLocalized("x-custom", customElements, { prefix: "x" });