/utils/userLocale
The userLocale utility module exports methods to get, put (create or overwrite), or delete a userLocale object in a userIndexedDB.
At current the module requires the userIndexedDB utility module to store the userLocale in an indexedDB.
Locales can be stored in the locales store.
The locales store is part of an [indexed] DB identified by the user and the workspace.
A workspace is unique to an XYZ instance.
A decorated locale object must be parsed with the jsonParser utility method in order to be stored as a JSON object in a store.
- Source
Requires
Methods
(inner) get(locale) → {Object}
The get method requests a locale stored in a userIndexedDB.
Name | Type | Description |
---|---|---|
locale | Object |
Name | Type | Description |
---|---|---|
locale.userLocale | Object | The userLocale config. |
locale.workspace | Object | Identifies the XYZ instance. |
locale.name | Object | The custom name under which a locale is stored. |
- Source
Returns a locale object stored as a userLocale.
- Type:
- Object
(inner) list(workspace)
Requests an array of locales [key, name] from the 'locales' database store.
Name | Type | Description |
---|---|---|
workspace | string | The workspace identifier. |
- Source
(inner) put(params)
The put method stores the params object in the userIndexedDB.
Name | Type | Description |
---|---|---|
params | Object |
Name | Type | Description |
---|---|---|
params.store | string | The store identifier. |
params.workspace | string | The workspace identifier. |
params.name | string | The custom name under which the object is stored. |
params.object | Object | The object to be stored in the userIndexedDB. |
- Source
(inner) putLocale(mapview) → {Object}
The putLocale method calls the put method to store a locale object in the userIndexedDB.
Name | Type | Description |
---|---|---|
mapview | Object | The mapview object. |
Name | Type | Description |
---|---|---|
params | string | The params object. |
- Source
Returns the response object from the put method.
- Type:
- Object
(inner) remove(locale)
The method removes a locale from the database 'locales' store.
Name | Type | Description |
---|---|---|
locale | Object |
Name | Type | Description |
---|---|---|
locale.workspace | Object | The workspace identifier. |
locale.name | Object | The custom name under which a locale is stored. |
- Source