TranslationStoreService
Defined in: src/services/translation-store.service.ts:35
Core service as abstraction layer for translaton storage and state management
Since
1.0.0
Author
Simon Kovtyk
Constructors
Constructor
new TranslationStoreService(): TranslationStoreService;Defined in: src/services/translation-store.service.ts:58
Returns
TranslationStoreService
Methods
addNotifierScope()
addNotifierScope(notifierScope): void;Defined in: src/services/translation-store.service.ts:317
Add a notifier scope
Parameters
| Parameter | Type | Description |
|---|---|---|
notifierScope | Readonly<NotifierScope> | The notifier scope to add |
Returns
void
Since
1.0.0
Author
Simon Kovtyk
addNotifierScopes()
addNotifierScopes(notifierScopes): void;Defined in: src/services/translation-store.service.ts:331
Add multiple notifier scopes
Parameters
| Parameter | Type | Description |
|---|---|---|
notifierScopes | NotifierScopes | The notifier scopes to add |
Returns
void
Since
1.0.0
Author
Simon Kovtyk
addNotifierToNotifierScope()
addNotifierToNotifierScope(scopeName, notifier): void;Defined in: src/services/translation-store.service.ts:346
Add a notifier to a notifier scope
Parameters
| Parameter | Type | Description |
|---|---|---|
scopeName | string | null | The name of the scope |
notifier | Subject<Readonly<Record<string, string>>> | The notifier to add |
Returns
void
Since
1.0.0
Author
Simon Kovtyk
areScopeNamesInNotifierScopes()
areScopeNamesInNotifierScopes(scopeNames): boolean;Defined in: src/services/translation-store.service.ts:262
Check if scope names are in notifier scopes
Parameters
| Parameter | Type | Description |
|---|---|---|
scopeNames | readonly (string | null)[] | An Array of scope names, that should be checked |
Returns
boolean
true if all are found, otherwise false
Since
1.0.0
Author
Simon Kovtyk
getCurrentLocale()
getCurrentLocale(): LocaleConfig;Defined in: src/services/translation-store.service.ts:94
Get the current LocaleConfig
Returns
The current LocaleConfig
Since
1.0.0
Author
Simon Kovtyk
getExistingNotifierScopes()
getExistingNotifierScopes(scopeNames): (string | null)[];Defined in: src/services/translation-store.service.ts:276
Check which scope names are in notifier scopes
Parameters
| Parameter | Type | Description |
|---|---|---|
scopeNames | readonly (string | null)[] | An Array of scope names, that should be checked |
Returns
(string | null)[]
An Array of existing scope names
Since
1.0.0
Author
Simon Kovtyk
getExistingScopes()
getExistingScopes(scopeNames): (string | null)[];Defined in: src/services/translation-store.service.ts:236
Check which scopes exist
Parameters
| Parameter | Type | Description |
|---|---|---|
scopeNames | readonly (string | null)[] | An Array of scope names, that should be checked |
Returns
(string | null)[]
An Array of existing scope names
Since
1.0.0
Author
Simon Kovtyk
getLocale$()
getLocale$(): Observable<LocaleConfig>;Defined in: src/services/translation-store.service.ts:106
Get an Observable of the current LocaleConfig
Returns
Observable<LocaleConfig>
An Observable of the current LocaleConfig
Since
1.0.0
Author
Simon Kovtyk
getLocales()
getLocales(): LocaleConfig[];Defined in: src/services/translation-store.service.ts:142
Get all defined locales
Returns
An Array of all defined locales
Since
1.0.0
Author
Simon Kovtyk
getNotiferScope()
getNotiferScope(scopeName): NotifierScope | undefined;Defined in: src/services/translation-store.service.ts:289
Get NotifierScope by scope name
Parameters
| Parameter | Type | Description |
|---|---|---|
scopeName | string | null | The name of the scope |
Returns
NotifierScope | undefined
if found NotifierScope, otherwise undefined
Since
1.0.0
Author
Simon Kovtyk
getNotifierScopes()
getNotifierScopes(scopeNames): NotifierScopes | undefined;Defined in: src/services/translation-store.service.ts:302
Get NotifierScopes by scope names
Parameters
| Parameter | Type | Description |
|---|---|---|
scopeNames | readonly (string | null)[] | An Array of scope names |
Returns
NotifierScopes | undefined
if found NotifierScopes, otherwise undefined
Since
1.0.0
Author
Simon Kovtyk
getScopedFile()
getScopedFile(scopeName): Readonly<Record<string, string>> | undefined;Defined in: src/services/translation-store.service.ts:176
Get a scoped file
Parameters
| Parameter | Type | Description |
|---|---|---|
scopeName | string | null | The name of the scope, the ScopedFile belongs to |
Returns
Readonly<Record<string, string>> | undefined
if found ScopedFile, otherwise undefined
Since
1.0.0
Author
Simon Kovtyk
getSourceLocale()
getSourceLocale(): LocaleConfig | undefined;Defined in: src/services/translation-store.service.ts:381
Get the source LocaleConfig
Returns
LocaleConfig | undefined
if defined LocaleConfig, otherwise undefined
Since
1.0.0
Author
Simon Kovtyk
hasScopedFile()
hasScopedFile(scopeName): boolean;Defined in: src/services/translation-store.service.ts:191
Check if a scoped file exists
Parameters
| Parameter | Type | Description |
|---|---|---|
scopeName | string | null | The name of the scope, the ScopedFile belongs to |
Returns
boolean
true if found, otherwise false
Since
1.0.0
Author
Simon Kovtyk
hasScopedFiles()
hasScopedFiles(scopeNames): boolean;Defined in: src/services/translation-store.service.ts:206
Check if scoped files exist
Parameters
| Parameter | Type | Description |
|---|---|---|
scopeNames | readonly (string | null)[] | An Array of scope names, the ScopedFiles belong to |
Returns
boolean
true if all could be found, otherwise false
Since
1.0.0
Author
Simon Kovtyk
isScopeExisting()
isScopeExisting(scopeName): boolean;Defined in: src/services/translation-store.service.ts:221
Check if a scope exists
Parameters
| Parameter | Type | Description |
|---|---|---|
scopeName | string | null | The name of the scope |
Returns
boolean
true if found, otherwise false
Since
1.0.0
Author
Simon Kovtyk
isScopeNameInNotifierScopes()
isScopeNameInNotifierScopes(scopeName): boolean;Defined in: src/services/translation-store.service.ts:249
Check if scope name is in notifier scopes
Parameters
| Parameter | Type | Description |
|---|---|---|
scopeName | string | null | The name of the scope |
Returns
boolean
true if found, otherwise false
Since
1.0.0
Author
Simon Kovtyk
removeNotifierScope()
removeNotifierScope(scopeName): void;Defined in: src/services/translation-store.service.ts:366
Remove a notifier scope
Parameters
| Parameter | Type | Description |
|---|---|---|
scopeName | string | null | The name of the scope |
Returns
void
Since
1.0.0
Author
Simon Kovtyk
setLocale()
setLocale(locale): void;Defined in: src/services/translation-store.service.ts:119
Set the current LocaleConfig
Parameters
| Parameter | Type | Description |
|---|---|---|
locale | LocaleConfig | The locale to set |
Returns
void
Throws
LocaleNotDefinedError if the provided locale is not defined
Since
1.0.0
Author
Simon Kovtyk
setScopedFile()
setScopedFile(scopeName, file): void;Defined in: src/services/translation-store.service.ts:155
Set a scoped file
Parameters
| Parameter | Type | Description |
|---|---|---|
scopeName | string | null | The name of the scope |
file | ScopedFile | The scoped file to set |
Returns
void
Since
1.0.0
Author
Simon Kovtyk