/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
(async, inner) get(locale) → {Object}
The get method requests a locale stored in a userIndexedDB.
Name | Type | Description |
---|---|---|
locale | Object |
Name | Type | Description |
---|---|---|
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
(async, inner) list(workspace)
Requests an array of locales [key, name] from the 'locales' database store.
Name | Type | Description |
---|---|---|
workspace | string | The workspace identifier. |
- Source
(async, inner) putLocale(mapview) → {Promise.<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:
- Promise.<Object>
(async, 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