File

packages/core/src/lib/services/i18n/i18n.service.ts

Extends

EuiLazyService

Index

Methods

Constructor

constructor()

Methods

Public addResources
addResources(config: I18nLoaderConfig, moduleName?: string)

Add resources based of a config loader

Parameters :
Name Type Optional Description
config I18nLoaderConfig No

I18nLoaderConfig

moduleName string Yes

Promise an EuiServiceStatus when translation has fully loaded

getSignal
getSignal()

This method is used to get the state as readonly signal.

Returns : Signal<T>
getState
getState()
Returns : Observable<T>
getState
this will be removed in a future version
getState(mapFn?: (state?: T) => void)
Type parameters :
  • K
Parameters :
Name Type Optional
mapFn function Yes
Returns : Observable<K>
getState
getState(key?: a)
Type parameters :
  • a
Parameters :
Name Type Optional
key a Yes
Returns : Observable<DeepPartial<a>>
getState
getState(keyOrMapFn?: unknown | string)
Type parameters :
  • K
Parameters :
Name Type Optional
keyOrMapFn unknown | string Yes
Returns : Observable<DeepPartial<K>>
init
init(langState?: T)
Parameters :
Name Type Optional
langState T Yes
Public lazyLoad
lazyLoad(config: I18nLoaderConfig)
Parameters :
Name Type Optional
config I18nLoaderConfig No
lazyLoadInit
lazyLoadInit(moduleConfig: ModuleConfig, moduleName?: string)
Parameters :
Name Type Optional
moduleConfig ModuleConfig No
moduleName string Yes
onReady
onReady(moduleName?: string)

A pipe function that could serve as a wrapper of another observable e.g. ngx-translate i18n.onReady('my_module').pipe(switchMap(()=>translate.get('eui.KEY'))); WARNING: onReady will emit only once for a loaded Module, going to another and then going back will not result into another emission.

fetch module name from the state.

Parameters :
Name Type Optional Description
moduleName string Yes

the name of the module that has been given through the eUI globalConfig. In case non provided fetch module name from the state.

updateState
updateState(state: DeepPartial)
Parameters :
Name Type Optional
state DeepPartial<T> No
Returns : void
updateState
it will be removed in next version. Use updateState(partialState: DeepPartial) instead
updateState(slice: DeepPartial, reducer: (state: T, action: DeepPartial) => void)
Parameters :
Name Type Optional
slice DeepPartial<T> No
reducer function No
Returns : void
updateState
updateState(state: DeepPartial, reducer?: (state?: T, action?: DeepPartial) => void)
Type parameters :
  • K
Parameters :
Name Type Optional
state DeepPartial<K> No
reducer function Yes
Returns : void

results matching ""

    No results matching ""