Skip to content

pantoken / renderers/svelte/src / registerLocalized

Mahi: registerLocalized()

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

Whakamātautau

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

Ka tango i tētahi LocaleBundle kua whakatau katoa rānei tētahi taura tapanga BCP47 mata. Mēnā ka tukuna he taura, ka whakaputa e makeStrings ngā ingoa rā o te wiki mā te whakamahi i Intl.DateTimeFormat ā, ka huri ngā atu kuputuhi ki te reo Pākehā; tukuna he bundle mō ngā whakamāoritanga katoa.

Ngā Tawhā

bundle

string | LocaleBundle

He tūāpapa 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" });