Skip to content

pantoken / renderers/web-components/src / registerLocalized

Mahi: registerLocalized()

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

Alpha

Rēhita ngā waahanga ritenga me ngā kuputuhi ā-rohe me te ahunga.

Ka whakaae i tētahi LocaleBundle kua oti te whakaū rānei he taura tapanga BCP47 mata. Mēnā ka whiua he taura, ka tango e makeStrings ngā ingoa o ngā rā mā te whakamahi i Intl.DateTimeFormat ā, ko ērā atu taura ka huri atu ki te Reo Pākehā; tukuna he bundle mō ngā whakamāoritanga katoa.

Ngā Tawhā

bundle

string | LocaleBundle

He tūemi LocaleBundle, rānei he tapanga BCP47 ("hu", "ar", …).

target?

ElementRegistry

Te rēhita hei tautuhi (taunoa ki globalThis.customElements).

options?

Ka tukuna mā runga ki register() (hei tauira prefix, only).

prefix?

string | null

only?

readonly string[]

Whakahokia

void

Tauira

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

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