Skip to content

Commit 5b023d5

Browse files
author
Andrea Barbasso
committed
[UXP-126] manage language
1 parent 8268c97 commit 5b023d5

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

src/app/directives/text-select/text-selection-tooltip/text-selection-tooltip.component.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
import {
22
ChangeDetectionStrategy,
33
ChangeDetectorRef,
4-
Component, ElementRef,
4+
Component,
55
HostBinding,
6-
HostListener, Inject,
6+
HostListener,
7+
Inject,
78
Input,
89
NgZone,
910
OnDestroy,
1011
OnInit
1112
} from '@angular/core';
1213
import { NgIf } from '@angular/common';
1314
import { NativeWindowRef, NativeWindowService } from '../../../core/services/window.service';
15+
import { TranslateService } from '@ngx-translate/core';
1416

1517
@Component({
1618
selector: 'ds-text-selection-tooltip',
@@ -60,7 +62,7 @@ export class TextSelectionTooltipComponent implements OnInit, OnDestroy {
6062
@Inject(NativeWindowService) protected _window: NativeWindowRef,
6163
private changeDetectorRef: ChangeDetectorRef,
6264
private ngZone: NgZone,
63-
private element: ElementRef) {
65+
private translate: TranslateService) {
6466

6567
}
6668

@@ -95,6 +97,7 @@ export class TextSelectionTooltipComponent implements OnInit, OnDestroy {
9597
speechSynthesis.cancel();
9698
}
9799
this.utterance = new SpeechSynthesisUtterance(this.text);
100+
this.utterance.lang = this.translate.currentLang;
98101
this.utterance.onend = () => {
99102
this.utterance = null;
100103
this.changeDetectorRef.detectChanges();

0 commit comments

Comments
 (0)