Skip to content

@i18n-micro/solid

33 exports across 1 entry point. Generated from the API snapshot that pnpm run api:surface checks against the TypeScript sources.

@i18n-micro/solid

ts
import { /* … */ } from '@i18n-micro/solid'
ExportKindSignature
CleanTranslationtypestring | number | boolean | Translations | PluralTranslations | null
createI18nfunction(options: SolidI18nOptions) => SolidI18n
createSolidRouterAdapterfunction(locales: Locale[], defaultLocale: string, navigate: NavigateFunction, location: Location) => I18nRoutingStrategy & { getCurrentPathAccessor: Accessor<string>; }
defaultPluralconstPluralFunc
FormatServiceclass19 members
Gettertype(key: TranslationKey, params?: Record<string, string | number | boolean>, defaultValue?: string) => unknown
I18nContextconstimport("solid-js/types/index").Context<SolidI18n | undefined>
I18nDefaultLocaleContextconstimport("solid-js/types/index").Context<string | undefined>
I18nGroupconstComponent<I18nGroupProps>
I18nLinkconstComponent<I18nLinkProps>
I18nLocalesContextconstimport("solid-js/types/index").Context<Locale[] | undefined>
I18nProviderconstParentComponent<I18nProviderProps>
I18nProviderPropsinterface4 members
I18nRouterContextconstimport("solid-js/types/index").Context<I18nRoutingStrategy | undefined>
I18nRoutingStrategyinterface7 members
I18nSwitcherconstComponent<I18nSwitcherProps>
I18nTconstComponent<I18nTProps>
interpolatefunction(template: string, params: Params) => string
Localeinterface11 members
LocaleCodetypestring
ModuleOptionsinterface46 members
ParamstypeRecord<string, string | number | boolean>
PluralFunctype(key: TranslationKey, count: number, params: Params, locale: string, getter: Getter) => string | null
SolidI18nclass53 members
SolidI18nOptionsinterface6 members
TranslationKeytypekeyof DefineLocaleMessage extends never ? string : keyof DefineLocaleMessage | string
Translationsinterface1 members
useI18nfunction(options?: UseI18nOptions) => { instance: import("packages/solid/src/i18n").SolidI18n; locale: import("solid-js/types/index").Accessor<string>; getLocales: () => Locale[]; defaultLocale: () => string; getLocaleName: () => string | null; localeRoute: (to: string | { path?: string; }, localeCode?: string) => string | { path?: string; }; localePath: (to: string | { path?: string; }, locale?: string) => string; switchLocale: (newLocale: string) => void; t: (key: import("packages/types/dist/index").TranslationKey, params?: import("packages/types/dist/index").Params, defaultValue?: string | null, routeContext?: unknown) => import("packages/types/dist/index").CleanTranslation; ts: (key: import("packages/types/dist/index").TranslationKey, params?: import("packages/types/dist/index").Params, defaultValue?: string, routeContext?: unknown) => string; tc: (key: import("packages/types/dist/index").TranslationKey, count: number | import("packages/types/dist/index").Params, defaultValue?: string) => string; tn: { (value: number, options?: Intl.NumberFormatOptions): string; (value: number, key: string, overrides?: Intl.NumberFormatOptions): string; (value: number, key: string, locale: string, overrides?: Intl.NumberFormatOptions): string; }; td: { (value: Date | number | string, options?: Intl.DateTimeFormatOptions): string; (value: Date | number | string, key: string, overrides?: Intl.DateTimeFormatOptions): string; (value: Date | number | string, key: string, locale: string, overrides?: Intl.DateTimeFormatOptions): string; }; tdr: (value: Date | number | string, options?: Intl.RelativeTimeFormatOptions) => string; has: (key: import("packages/types/dist/index").TranslationKey, routeContext?: unknown) => boolean; setRoute: (val: string) => void; getRoute: () => string; getLocale: () => string; addTranslations: (locale: string, translations: import("packages/types/dist/index").Translations, merge?: boolean) => void; addRouteTranslations: (locale: string, routeName: string, translations: import("packages/types/dist/index").Translations, merge?: boolean) => void; resolveTranslations: (routeContext?: unknown) => import("packages/types/dist/index").Translations; setTranslation: (key: import("packages/types/dist/index").TranslationKey, value: unknown) => void; clearCache: () => void; }
useI18nContextconst() => SolidI18n
useI18nDefaultLocaleconst() => string
useI18nLocalesconst() => Locale[]
UseI18nOptionsinterface2 members
useI18nRouterconst() => I18nRoutingStrategy | undefined

FormatService — 19 members, identical to FormatService.

I18nProviderProps — 4 members
MemberType
defaultLocale?string | undefined
i18nSolidI18n
locales?Locale[] | undefined
routingStrategy?I18nRoutingStrategy | undefined
I18nRoutingStrategy — 7 members
MemberType
getCurrentPath() => string
getCurrentPathAccessor?(() => Accessor<string>) | undefined
getRoute?(() => { fullPath: string; query: Record<string, unknown>; }) | undefined
linkComponent?string | Component<{ [key: string]: unknown; href: string; children?: JSX.Element; style?: JSX.CSSProperties; class?: string; }> | undefined
push(target: { path: string; }) => void
replace(target: { path: string; }) => void
resolvePath?((to: string | { path?: string; }, locale: string) => string | { path?: string; }) | undefined
Locale — 11 members, identical to [`Locale`](/api/packages/types). ModuleOptions — 46 members, identical to [`ModuleOptions`](/api/packages/types).
SolidI18n — 53 members
MemberType
_fallbackSignalprivate Accessor<string>
_localeSignalprivate Accessor<string>
_routeSignalprivate Accessor<string>
_setLocaleSignalprivate (v: string) => void
_setRouteSignalprivate (v: string) => void
addRouteTranslations(locale: string, routeName: string, translations: Translations, merge?: boolean) => void
addTranslations(locale: string, translations: Translations, merge?: boolean) => void
clearCache() => void
currentRoutestring
fallbackLocalestring
formatterFormatService
getCustomMissingHandler?(() => MissingHandler | null) | undefined
getFallbackLocale() => string
getLocale() => string
getMissingContextprotected (routeContext?: unknown) => { locale: string; routeName: string; }
getRoute() => string
getSnapshot() => string
has(key: TranslationKey, routeContext?: unknown) => boolean
helper{ hasCache(locale: string, page: string): boolean; getCache(locale: string, routeName: string): Translations | undefined; setCache(_locale: string, _routeName: string, _cache: Map<string, unknown>): void; hasTranslation(locale: string, key: string): boolean; hasPageTranslation(locale: string, routeName: string): boolean; getTranslation<T = unknown>(locale: string, routeName: string, key: string): T | null; loadTranslations(locale: string, data: Translations, routeName?: string): void; setTranslations(locale: string, data: Translations, routeName?: string): void; loadPageTranslations(locale: string, routeName: string, data: Translations): void; mergeTranslation(locale: string, routeName: string, newTranslations: Translations, _force?: boolean): void; clearCache(): void; }
listenersprivate Set<() => void>
loadRouteTranslationsCore(locale: string, routeName: string, translations: Translations, merge: boolean) => void
loadTranslationsCore(locale: string, translations: Translations, merge: boolean, routeName?: string) => void
localestring
localeAccessorAccessor<string>
missingHandler?((locale: string, key: string, routeName: string) => void) | undefined
missingWarnboolean
new(options: SolidI18nOptions): SolidI18n
notifyListenersprivate () => void
onTranslationsChangedprotected () => void
pluralFuncPluralFunc
resolveDateTimeFormatArgsprivate any
resolveHasprotected (key: TranslationKey, routeContext?: unknown) => boolean
resolveLookupprotected (key: TranslationKey, routeContext?: unknown) => unknown | null
resolveNumberFormatArgsprivate any
resolveRouteNameprotected (routeContext?: unknown) => string
resolveTranslations(routeContext?: unknown) => Translations
resolveTranslationTreeprotected (lower: Record<string, unknown>, upper: Record<string, unknown>) => Translations
routeAccessorAccessor<string>
setRoute(val: string) => void
setTranslation(key: TranslationKey, value: unknown) => void
storageTranslationStorage
storeprivate ReactiveI18nStore
subscribe(cb: () => void) => () => void
t(key: TranslationKey, params?: Params, defaultValue?: string | null, routeContext?: unknown) => CleanTranslation
tc(key: TranslationKey, count: number | Params, defaultValue?: string) => string
td{ (value: Date | number | string, options?: Intl.DateTimeFormatOptions): string; (value: Date | number | string, key: string, overrides?: Intl.DateTimeFormatOptions): string; (value: Date | number | string, key: string, locale: string, overrides?: Intl.DateTimeFormatOptions): string; }
tdr(value: Date | number | string, options?: Intl.RelativeTimeFormatOptions) => string
tn{ (value: number, options?: Intl.NumberFormatOptions): string; (value: number, key: string, overrides?: Intl.NumberFormatOptions): string; (value: number, key: string, locale: string, overrides?: Intl.NumberFormatOptions): string; }
touchprotected () => void
ts(key: TranslationKey, params?: Params, defaultValue?: string, routeContext?: unknown) => string
warnDevprotected (message: string) => void
warnMissingprotected (key: TranslationKey, routeContext?: unknown) => void
warnMissingFormatprotected (kind: "number" | "datetime", key: string, locale: string) => void
SolidI18nOptions — 6 members, identical to [`PreactI18nOptions`](/api/packages/preact). Translations — 1 members, identical to [`Translations`](/api/packages/types). UseI18nOptions — 2 members, identical to [`UseI18nOptions`](/api/packages/preact).

Back to all packages · Integration guides

Released under the MIT License.