1
1
import UI5Element from "@ui5/webcomponents-base/dist/UI5Element.js" ;
2
2
import ItemNavigation from "@ui5/webcomponents-base/dist/delegate/ItemNavigation.js" ;
3
3
import litRender from "@ui5/webcomponents-base/dist/renderer/LitRenderer.js" ;
4
+ import { fetchI18nBundle , getI18nBundle } from "@ui5/webcomponents-base/dist/i18nBundle.js" ;
4
5
import ResizeHandler from "@ui5/webcomponents-base/dist/delegate/ResizeHandler.js" ;
6
+ import { SEGMENTEDBUTTON_ARIA_DESCRIPTION } from "./generated/i18n/i18n-defaults.js" ;
5
7
6
8
// Template
7
9
import SegmentedButtonTemplate from "./generated/templates/SegmentedButtonTemplate.lit.js" ;
@@ -90,6 +92,10 @@ class SegmentedButton extends UI5Element {
90
92
return SegmentedButtonCss ;
91
93
}
92
94
95
+ static async onDefine ( ) {
96
+ await fetchI18nBundle ( "@ui5/webcomponents" ) ;
97
+ }
98
+
93
99
constructor ( ) {
94
100
super ( ) ;
95
101
this . initItemNavigation ( ) ;
@@ -99,6 +105,7 @@ class SegmentedButton extends UI5Element {
99
105
this . hasPreviouslyFocusedItem = false ;
100
106
101
107
this . _handleResizeBound = this . _handleResize . bind ( this ) ;
108
+ this . i18nBundle = getI18nBundle ( "@ui5/webcomponents" ) ;
102
109
}
103
110
104
111
onEnterDOM ( ) {
@@ -201,6 +208,10 @@ class SegmentedButton extends UI5Element {
201
208
get selectedButton ( ) {
202
209
return this . _selectedButton ;
203
210
}
211
+
212
+ get ariaDescription ( ) {
213
+ return this . i18nBundle . getText ( SEGMENTEDBUTTON_ARIA_DESCRIPTION ) ;
214
+ }
204
215
}
205
216
206
217
SegmentedButton . define ( ) ;
0 commit comments