Skip to content
Snippets Groups Projects
Unverified Commit d1d91044 authored by Bekerle, Patrizio's avatar Bekerle, Patrizio :fire:
Browse files

Add dbp-lang event

parent 34f22a4f
No related branches found
No related tags found
No related merge requests found
...@@ -36,6 +36,13 @@ The component emits `dbp-set-property` events for these attributes: ...@@ -36,6 +36,13 @@ The component emits `dbp-set-property` events for these attributes:
- `lang` to propagate a language change (possible values `en`, `de`) - `lang` to propagate a language change (possible values `en`, `de`)
- `requested-login-status` (possible values `logged-in`, `logged-out`) - `requested-login-status` (possible values `logged-in`, `logged-out`)
### Emitted events
#### dbp-lang
The component emits a `dbp-lang` event when the language is changed (for example in the language picker).
The `details` attribute of the event is the language (possible values `en`, `de`).
## Topic Metadata ## Topic Metadata
```json ```json
......
...@@ -296,6 +296,14 @@ export class AppShell extends ScopedElementsMixin(AdapterLitElement) { ...@@ -296,6 +296,14 @@ export class AppShell extends ScopedElementsMixin(AdapterLitElement) {
this.router.update(); this.router.update();
this.subtitle = this.activeMetaDataText("short_name"); this.subtitle = this.activeMetaDataText("short_name");
this.description = this.activeMetaDataText("description"); this.description = this.activeMetaDataText("description");
// send a dbp-lang event with the language
const event = new CustomEvent('dbp-lang', {
bubbles: true,
composed: true,
detail: this.lang
});
this.dispatchEvent(event);
break; break;
case 'metadata': case 'metadata':
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment