@@ -19,8 +19,7 @@ import { throttleTime } from "rxjs/operators";
1919
2020import { AbstractDropdownView } from "./abstract-dropdown-view.class" ;
2121import { position } from "../utils/position" ;
22-
23- const EN = require ( "./../i18n/en.json" ) ;
22+ import { I18n } from "./../i18n/i18n.module" ;
2423
2524/**
2625 * Drop-down lists enable users to select one or more items from a list.
@@ -116,10 +115,16 @@ export class Dropdown implements OnInit, AfterContentInit, OnDestroy {
116115 * @memberof Dropdown
117116 */
118117 @Input ( ) scrollableContainer : string ;
119-
120- @Input ( ) menuButtonLabel = EN . DROPDOWN . OPEN ;
121-
122- @Input ( ) selectedLabel = EN . DROPDOWN . SELECTED ;
118+ /**
119+ * Accessible label for the button that opens the dropdown list.
120+ * Defaults to the `DROPDOWN.OPEN` value from the i18n service.
121+ */
122+ @Input ( ) menuButtonLabel = this . i18n . get ( ) . DROPDOWN . OPEN ;
123+ /**
124+ * Provides the label for the "# selected" text.
125+ * Defaults to the `DROPDOWN.SELECTED` value from the i18n service.
126+ */
127+ @Input ( ) selectedLabel = this . i18n . get ( ) . DROPDOWN . SELECTED ;
123128 /**
124129 * Emits selection events.
125130 * @type {EventEmitter<Object> }
@@ -196,7 +201,7 @@ export class Dropdown implements OnInit, AfterContentInit, OnDestroy {
196201 * @param {TranslateService } translate
197202 * @memberof Dropdown
198203 */
199- constructor ( private elementRef : ElementRef ) { }
204+ constructor ( protected elementRef : ElementRef , protected i18n : I18n ) { }
200205
201206 /**
202207 * Updates the `type` property in the `@ContentChild`.
0 commit comments