@schukai/monster 3.97.0 → 3.97.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -17,13 +17,16 @@ import {
17
17
  ATTRIBUTE_ROLE,
18
18
  } from "../../dom/constants.mjs";
19
19
  import {CustomControl} from "../../dom/customcontrol.mjs";
20
- import {CustomElement, updaterTransformerMethodsSymbol} from "../../dom/customelement.mjs";
20
+ import {
21
+ CustomElement,
22
+ updaterTransformerMethodsSymbol,
23
+ } from "../../dom/customelement.mjs";
21
24
  import {
22
25
  assembleMethodSymbol,
23
26
  registerCustomElement,
24
27
  } from "../../dom/customelement.mjs";
25
28
  import {findTargetElementFromEvent} from "../../dom/events.mjs";
26
- import {isFunction} from "../../types/is.mjs";
29
+ import {isFunction, isObject} from "../../types/is.mjs";
27
30
  import {LocalePickerStyleSheet} from "./stylesheet/locale-picker.mjs";
28
31
  import {fireCustomEvent} from "../../dom/events.mjs";
29
32
  import {detectUserLanguagePreference} from "../../i18n/util.mjs";
@@ -69,7 +72,8 @@ const detectedLanguagesSymbol = Symbol("detectedLanguages");
69
72
  *
70
73
  * @fragments /fragments/components/accessibility/locale-picker/
71
74
  *
72
- * @example /examples/components/accessibility//locale-picker-simple
75
+ * @example /examples/components/accessibility/locale-picker-simple Simple example
76
+ * @example /examples/components/accessibility/locale-picker-reset Reset Selection
73
77
  *
74
78
  * @issue https://localhost.alvine.dev:8443/development/issues/closed/276.html
75
79
  *
@@ -90,7 +94,7 @@ class LocalePicker extends CustomElement {
90
94
 
91
95
  /**
92
96
  *
93
- * @return {Components.LocalePicker
97
+ * @return {LocalePicker}
94
98
  */
95
99
  [assembleMethodSymbol]() {
96
100
  super[assembleMethodSymbol]();
@@ -109,12 +113,16 @@ class LocalePicker extends CustomElement {
109
113
  * @property {Object} templates Template definitions
110
114
  * @property {string} templates.main Main template
111
115
  * @property {Object} labels Label definitions
112
- * @property {Object} actions Callbacks
113
- * @property {string} actions.click="throw Error" Callback when clicked
116
+ * @property {string} labels.headline Headline
117
+ * @property {string} labels.text Text
118
+ * @property {string} labels.button-label Button label
119
+ * @property {string} labels.button-no-thanks Button no thanks
120
+ * @property {string} labels.headline-other Headline other languages
121
+ * @property {Function} callbacks.getTranslation Callback to get the translation for the labels
114
122
  * @property {Object} features Features
115
- * @property {boolean} features.removeOnSelected=false Remove the element when a language is selected
116
- * @property {Object} classes CSS classes
117
- * @property {boolean} disabled=false Disabled state
123
+ * @property {boolean} features.removeOnSelected Remove the element when a language is selected
124
+ * @property {boolean} features.showAlways Show the element always
125
+ * @property {boolean} disabled Disabled state
118
126
  */
119
127
  get defaults() {
120
128
  return Object.assign({}, super.defaults, {
@@ -122,21 +130,21 @@ class LocalePicker extends CustomElement {
122
130
  main: getTemplate(),
123
131
  },
124
132
  labels: {
125
- "headline": "Welcome to our Website",
126
- "text": "This page is currently displayed in ${currentLabel}. However, we also offer this page in your preferred language. Would you like to switch?",
133
+ headline: "Welcome to our Website",
134
+ text: "This page is currently displayed in ${currentLabel}. However, we also offer this page in your preferred language. Would you like to switch?",
127
135
  "button-label": "Switch to ${preferred.label}",
128
136
  "button-no-thanks": "No, thanks",
129
137
  "headline-other": "Other languages",
130
138
  },
131
- classes: {},
139
+
140
+ callbacks: {
141
+ "getTranslation": getTranslation,
142
+ },
143
+
132
144
  disabled: false,
133
145
  features: {
134
146
  removeOnSelected: false,
135
- },
136
- actions: {
137
- click: () => {
138
- throw new Error("the click action is not defined");
139
- },
147
+ showAlways: false,
140
148
  },
141
149
  });
142
150
  }
@@ -145,60 +153,92 @@ class LocalePicker extends CustomElement {
145
153
  * Private method that provides a mapping of transformer methods keyed by their names.
146
154
  * These transformer methods define custom transformations for given input values.
147
155
  *
148
- * @returns {Object} An object containing transformer methods. Each method is keyed by its name.
149
- * The provided transformer "my-transformer" processes an input value based on its type:
150
- * - Appends "!" if the value is a string.
151
- * - Increments the value by 1 if the type is "Zahl".
152
- * - Returns the value unchanged for other types.
156
+ * @private
157
+ * @return {Object} An object containing transformer methods for internal use.
153
158
  */
154
159
  [updaterTransformerMethodsSymbol]() {
155
160
  return {
156
161
  "replace-placeholder": (value) => {
157
- const formatter = new Formatter(this[detectedLanguagesSymbol])
162
+ const formatter = new Formatter(this[detectedLanguagesSymbol]);
158
163
  return formatter.format(value);
159
-
160
- }
164
+ },
161
165
  };
162
- };
163
-
166
+ }
164
167
 
165
168
  /**
166
169
  * Lifecycle method that is called when the custom element is appended into a document-connected element.
167
170
  * Invokes the parent class's connectedCallback method and retrieves the user's preferred language.
168
171
  * Logs the preferred language to the console.
169
172
  *
170
- * @return {void} This method does not return a value.
173
+ * @return {void}
171
174
  */
172
175
  connectedCallback() {
173
176
  super.connectedCallback();
174
177
 
175
178
  this[detectedLanguagesSymbol] = detectUserLanguagePreference();
176
179
 
180
+ if (!isObject(this[detectedLanguagesSymbol]?.preferred) && this.getOption("features.showAlways") !== true) {
181
+ this.hide();
182
+
183
+ if (this.getOption("features.removeOnSelected")) {
184
+ this.remove();
185
+ }
186
+ return;
187
+ }
188
+
189
+ if (!isObject(this[detectedLanguagesSymbol]?.preferred)) {
190
+ this[detectedLanguagesSymbol].preferred = {
191
+ fullLang: "en",
192
+ baseLang: "en",
193
+ label: "English",
194
+ }
195
+ }
196
+
177
197
  const stored = localStorage.getItem(buildStorageKey.call(this));
178
- if (stored) {
198
+ if (stored&& this.getOption("features.showAlways") !== true) {
179
199
  if (this.getOption("features.removeOnSelected")) {
180
200
  this.remove();
181
201
  }
182
202
  return;
183
203
  }
184
204
 
185
- this.style.display = "block";
205
+ this.show();
186
206
 
187
- if (this[otherLanguagesElementSymbol] instanceof HTMLElement &&
207
+ if (
208
+ this[otherLanguagesElementSymbol] instanceof HTMLElement &&
188
209
  this[detectedLanguagesSymbol].offerable &&
189
- this[detectedLanguagesSymbol].offerable.length > 1) {
210
+ this[detectedLanguagesSymbol].offerable.length > 1
211
+ ) {
190
212
  this[otherLanguagesElementSymbol].classList.remove("hidden");
191
- this[otherLanguagesElementSymbol].setOption('mapping.labelTemplate', '${label}')
192
- this[otherLanguagesElementSymbol].setOption('mapping.valueTemplate', '${href}')
193
- this[otherLanguagesElementSymbol].importOptions(this[detectedLanguagesSymbol]?.offerable || []);
213
+ this[otherLanguagesElementSymbol].setOption(
214
+ "mapping.labelTemplate",
215
+ "${label}",
216
+ );
217
+ this[otherLanguagesElementSymbol].setOption(
218
+ "mapping.valueTemplate",
219
+ "${href}",
220
+ );
221
+ this[otherLanguagesElementSymbol].importOptions(
222
+ this[detectedLanguagesSymbol]?.offerable || [],
223
+ );
194
224
  }
195
225
 
196
- const translations = getTranslation(this[detectedLanguagesSymbol].offerable[0].baseLang);
197
- this.setOption('labels', translations.labels);
198
- if (this[otherLanguagesElementSymbol]) {
199
- this[otherLanguagesElementSymbol].setOption('labels.select-an-option', translations.selectAnOption);
226
+ if (this[detectedLanguagesSymbol].offerable && this[detectedLanguagesSymbol].offerable.length > 0) {
227
+ const getTranslationCallback = this.getOption("callbacks.getTranslation");
228
+ if (isFunction(getTranslationCallback)) {
229
+ const translations = getTranslationCallback(
230
+ this[detectedLanguagesSymbol].offerable[0].baseLang,
231
+ );
232
+
233
+ this.setOption("labels", translations.labels);
234
+ if (this[otherLanguagesElementSymbol]) {
235
+ this[otherLanguagesElementSymbol].setOption(
236
+ "labels.select-an-option",
237
+ translations.selectAnOption,
238
+ );
239
+ }
240
+ }
200
241
  }
201
-
202
242
  }
203
243
 
204
244
  /**
@@ -208,6 +248,38 @@ class LocalePicker extends CustomElement {
208
248
  */
209
249
  reset() {
210
250
  localStorage.removeItem(buildStorageKey.call(this));
251
+ this.show();
252
+ return this;
253
+ }
254
+
255
+ /**
256
+ * Hides the locale picker.
257
+ *
258
+ * @returns {LocalePicker}
259
+ */
260
+ hide() {
261
+ this.style.display = "none";
262
+
263
+ if(!this[localePickerElementSymbol]) {
264
+ return this;
265
+ }
266
+
267
+ this[localePickerElementSymbol].style.display = "none";
268
+ return this;
269
+ }
270
+
271
+ /**
272
+ * Shows the locale picker.
273
+ * @returns {LocalePicker}
274
+ */
275
+ show() {
276
+ this.style.display = "block";
277
+
278
+ if(!this[localePickerElementSymbol]) {
279
+ return this;
280
+ }
281
+
282
+ this[localePickerElementSymbol].style.display = "block";
211
283
  return this;
212
284
  }
213
285
 
@@ -260,20 +332,20 @@ function initEventHandler() {
260
332
  callback.call(self, event);
261
333
  });
262
334
 
263
- this[buttonNoThanksElementSymbol].setOption('actions.click', () => {
335
+ this[buttonNoThanksElementSymbol].setOption("actions.click", () => {
264
336
  localStorage.setItem(buildStorageKey.call(this), "1");
265
- this.style.display = "none";
337
+ this.hide();
266
338
  if (this.getOption("features.removeOnSelected")) {
267
339
  this.remove();
268
340
  }
269
341
  });
270
342
 
271
- this[buttonLanguageElementSymbol].setOption('actions.click', () => {
343
+ this[buttonLanguageElementSymbol].setOption("actions.click", () => {
272
344
  localStorage.setItem(buildStorageKey.call(this), "1");
273
- window.location.href = this[detectedLanguagesSymbol].offerable[0].href;
345
+ window.location.href = this[detectedLanguagesSymbol].offerable?.[0]?.href;
274
346
  });
275
347
 
276
- this[otherLanguagesElementSymbol].addEventListener('change', (event) => {
348
+ this[otherLanguagesElementSymbol].addEventListener("change", (event) => {
277
349
  const element = findTargetElementFromEvent(
278
350
  event,
279
351
  ATTRIBUTE_ROLE,
@@ -281,14 +353,13 @@ function initEventHandler() {
281
353
  );
282
354
 
283
355
  if (element) {
284
- const selected = element.value;
356
+ const selected = element?.value;
285
357
  if (selected) {
286
358
  localStorage.setItem(buildStorageKey.call(this), "1");
287
359
  window.location.href = selected;
288
360
  }
289
361
  }
290
-
291
- })
362
+ });
292
363
 
293
364
  return this;
294
365
  }
@@ -298,7 +369,7 @@ function initEventHandler() {
298
369
  * @returns {string}
299
370
  */
300
371
  function buildStorageKey() {
301
- return 'locale-picker-' + this[detectedLanguagesSymbol].current;
372
+ return "locale-picker-" + this[detectedLanguagesSymbol].current;
302
373
  }
303
374
 
304
375
  /**
@@ -308,246 +379,243 @@ function buildStorageKey() {
308
379
  */
309
380
  function getTranslation(lang) {
310
381
  const map = {
311
- "en": {
312
- "headline": "Welcome to our Website",
313
- "text": "This page is currently displayed in ${currentLabel}. However, we also offer this page in your preferred language. Would you like to switch?",
382
+ en: {
383
+ headline: "Welcome to our Website",
384
+ text: "This page is currently displayed in ${currentLabel}. However, we also offer this page in your preferred language. Would you like to switch?",
314
385
  "button-label": "Switch to ${preferred.label}",
315
386
  "button-no-thanks": "No, thanks",
316
- "headline-other": "Other languages"
387
+ "headline-other": "Other languages",
317
388
  },
318
- "de": {
319
- "headline": "Willkommen auf unserer Webseite",
320
- "text": "Diese Seite wird aktuell auf ${currentLabel} angezeigt. Wir bieten jedoch auch diese Seite in Ihrer bevorzugten Sprache an. Möchten Sie wechseln?",
389
+ de: {
390
+ headline: "Willkommen auf unserer Webseite",
391
+ text: "Diese Seite wird aktuell auf ${currentLabel} angezeigt. Wir bieten jedoch auch diese Seite in Ihrer bevorzugten Sprache an. Möchten Sie wechseln?",
321
392
  "button-label": "Wechseln zu ${preferred.label}",
322
393
  "button-no-thanks": "Nein, danke",
323
- "headline-other": "Andere Sprachen"
394
+ "headline-other": "Andere Sprachen",
324
395
  },
325
- "fr": {
326
- "headline": "Bienvenue sur notre site web",
327
- "text": "Cette page est actuellement affichée en ${currentLabel}. Cependant, nous proposons également cette page dans votre langue préférée. Souhaitez-vous changer?",
396
+ fr: {
397
+ headline: "Bienvenue sur notre site web",
398
+ text: "Cette page est actuellement affichée en ${currentLabel}. Cependant, nous proposons également cette page dans votre langue préférée. Souhaitez-vous changer?",
328
399
  "button-label": "Changer pour ${preferred.label}",
329
400
  "button-no-thanks": "Non, merci",
330
- "headline-other": "Autres langues"
401
+ "headline-other": "Autres langues",
331
402
  },
332
- "es": {
333
- "headline": "Bienvenido a nuestro sitio web",
334
- "text": "Esta página se muestra actualmente en ${currentLabel}. Sin embargo, también ofrecemos esta página en su idioma preferido. ¿Le gustaría cambiar?",
403
+ es: {
404
+ headline: "Bienvenido a nuestro sitio web",
405
+ text: "Esta página se muestra actualmente en ${currentLabel}. Sin embargo, también ofrecemos esta página en su idioma preferido. ¿Le gustaría cambiar?",
335
406
  "button-label": "Cambiar a ${preferred.label}",
336
407
  "button-no-thanks": "No, gracias",
337
- "headline-other": "Otros idiomas"
408
+ "headline-other": "Otros idiomas",
338
409
  },
339
- "it": {
340
- "headline": "Benvenuti sul nostro sito web",
341
- "text": "Questa pagina è attualmente visualizzata in ${currentLabel}. Tuttavia, offriamo anche questa pagina nella tua lingua preferita. Vuoi cambiare?",
410
+ it: {
411
+ headline: "Benvenuti sul nostro sito web",
412
+ text: "Questa pagina è attualmente visualizzata in ${currentLabel}. Tuttavia, offriamo anche questa pagina nella tua lingua preferita. Vuoi cambiare?",
342
413
  "button-label": "Cambia nella ${preferred.label}",
343
414
  "button-no-thanks": "No, grazie",
344
- "headline-other": "Altre lingue"
415
+ "headline-other": "Altre lingue",
345
416
  },
346
- "pt": {
347
- "headline": "Bem-vindo ao nosso site",
348
- "text": "Esta página está atualmente exibida em ${currentLabel}. No entanto, também oferecemos esta página no seu idioma preferido. Gostaria de mudar?",
417
+ pt: {
418
+ headline: "Bem-vindo ao nosso site",
419
+ text: "Esta página está atualmente exibida em ${currentLabel}. No entanto, também oferecemos esta página no seu idioma preferido. Gostaria de mudar?",
349
420
  "button-label": "Mudar para ${preferred.label}",
350
421
  "button-no-thanks": "Não, obrigado",
351
- "headline-other": "Outros idiomas"
422
+ "headline-other": "Outros idiomas",
352
423
  },
353
- "nl": {
354
- "headline": "Welkom op onze website",
355
- "text": "Deze pagina wordt momenteel weergegeven in ${currentLabel}. We bieden deze pagina echter ook aan in uw voorkeurstaal. Wilt u overschakelen?",
424
+ nl: {
425
+ headline: "Welkom op onze website",
426
+ text: "Deze pagina wordt momenteel weergegeven in ${currentLabel}. We bieden deze pagina echter ook aan in uw voorkeurstaal. Wilt u overschakelen?",
356
427
  "button-label": "Overschakelen naar ${preferred.label}",
357
428
  "button-no-thanks": "Nee, bedankt",
358
- "headline-other": "Andere talen"
429
+ "headline-other": "Andere talen",
359
430
  },
360
- "pl": {
361
- "headline": "Witamy na naszej stronie",
362
- "text": "Ta strona jest obecnie wyświetlana po ${currentLabel}. Oferujemy jednak również tę stronę w Twoim preferowanym języku. Czy chcesz przełączyć?",
431
+ pl: {
432
+ headline: "Witamy na naszej stronie",
433
+ text: "Ta strona jest obecnie wyświetlana po ${currentLabel}. Oferujemy jednak również tę stronę w Twoim preferowanym języku. Czy chcesz przełączyć?",
363
434
  "button-label": "Przełącz na ${preferred.label}",
364
435
  "button-no-thanks": "Nie, dziękuję",
365
- "headline-other": "Inne języki"
436
+ "headline-other": "Inne języki",
366
437
  },
367
- "ru": {
368
- "headline": "Добро пожаловать на наш сайт",
369
- "text": "Эта страница в настоящее время отображается на ${currentLabel}. Однако мы также предлагаем эту страницу на вашем предпочтительном языке. Хотите переключиться?",
438
+ ru: {
439
+ headline: "Добро пожаловать на наш сайт",
440
+ text: "Эта страница в настоящее время отображается на ${currentLabel}. Однако мы также предлагаем эту страницу на вашем предпочтительном языке. Хотите переключиться?",
370
441
  "button-label": "Переключиться на ${preferred.label}",
371
442
  "button-no-thanks": "Нет, спасибо",
372
- "headline-other": "Другие языки"
443
+ "headline-other": "Другие языки",
373
444
  },
374
- "cs": {
375
- "headline": "Vítejte na našem webu",
376
- "text": "Tato stránka je aktuálně zobrazena v ${currentLabel}. Nabízíme však tuto stránku také ve vašem preferovaném jazyce. Chcete přejít?",
445
+ cs: {
446
+ headline: "Vítejte na našem webu",
447
+ text: "Tato stránka je aktuálně zobrazena v ${currentLabel}. Nabízíme však tuto stránku také ve vašem preferovaném jazyce. Chcete přejít?",
377
448
  "button-label": "Přejít na ${preferred.label}",
378
449
  "button-no-thanks": "Ne, děkuji",
379
- "headline-other": "Další jazyky"
450
+ "headline-other": "Další jazyky",
380
451
  },
381
- "sk": {
382
- "headline": "Vitajte na našej webovej stránke",
383
- "text": "Táto stránka je v súčasnosti zobrazená v ${currentLabel}. Ponúkame však túto stránku aj vo vašom preferovanom jazyku. Chcete prejsť?",
452
+ sk: {
453
+ headline: "Vitajte na našej webovej stránke",
454
+ text: "Táto stránka je v súčasnosti zobrazená v ${currentLabel}. Ponúkame však túto stránku aj vo vašom preferovanom jazyku. Chcete prejsť?",
384
455
  "button-label": "Prepnúť na ${preferred.label}",
385
456
  "button-no-thanks": "Nie, ďakujem",
386
- "headline-other": "Iné jazyky"
457
+ "headline-other": "Iné jazyky",
387
458
  },
388
459
 
389
-
390
- "bg": {
391
- "headline": "Добре дошли на нашия уебсайт",
392
- "text": "Тази страница в момента се показва на ${currentLabel}. Въпреки това, предлагаме също тази страница на Вашия предпочитан език. Желаете ли да превключите?",
460
+ bg: {
461
+ headline: "Добре дошли на нашия уебсайт",
462
+ text: "Тази страница в момента се показва на ${currentLabel}. Въпреки това, предлагаме също тази страница на Вашия предпочитан език. Желаете ли да превключите?",
393
463
  "button-label": "Превключете на ${preferred.label}",
394
464
  "button-no-thanks": "Не, благодаря",
395
- "headline-other": "Други езици"
465
+ "headline-other": "Други езици",
396
466
  },
397
- "hr": {
398
- "headline": "Dobrodošli na našu web stranicu",
399
- "text": "Ova stranica trenutno je prikazana na ${currentLabel}. Međutim, nudimo i ovu stranicu na vašem preferiranom jeziku. Želite li prebaciti?",
467
+ hr: {
468
+ headline: "Dobrodošli na našu web stranicu",
469
+ text: "Ova stranica trenutno je prikazana na ${currentLabel}. Međutim, nudimo i ovu stranicu na vašem preferiranom jeziku. Želite li prebaciti?",
400
470
  "button-label": "Prebaci na ${preferred.label}",
401
471
  "button-no-thanks": "Ne, hvala",
402
- "headline-other": "Drugi jezici"
472
+ "headline-other": "Drugi jezici",
403
473
  },
404
- "fi": {
405
- "headline": "Tervetuloa verkkosivustollemme",
406
- "text": "Tämä sivu on tällä hetkellä näkyvissä ${currentLabel}. Tarjoamme kuitenkin tätä sivua myös suosimallasi kielellä. Haluaisitko vaihtaa?",
474
+ fi: {
475
+ headline: "Tervetuloa verkkosivustollemme",
476
+ text: "Tämä sivu on tällä hetkellä näkyvissä ${currentLabel}. Tarjoamme kuitenkin tätä sivua myös suosimallasi kielellä. Haluaisitko vaihtaa?",
407
477
  "button-label": "Vaihda ${preferred.label}",
408
478
  "button-no-thanks": "Ei kiitos",
409
- "headline-other": "Muut kielet"
479
+ "headline-other": "Muut kielet",
410
480
  },
411
- "sv": {
412
- "headline": "Välkommen till vår webbplats",
413
- "text": "Denna sida visas för närvarande på ${currentLabel}. Vi erbjuder dock även denna sida på ditt föredragna språk. Skulle du vilja byta?",
481
+ sv: {
482
+ headline: "Välkommen till vår webbplats",
483
+ text: "Denna sida visas för närvarande på ${currentLabel}. Vi erbjuder dock även denna sida på ditt föredragna språk. Skulle du vilja byta?",
414
484
  "button-label": "Byt till ${preferred.label}",
415
485
  "button-no-thanks": "Nej tack",
416
- "headline-other": "Andra språk"
486
+ "headline-other": "Andra språk",
417
487
  },
418
- "el": {
419
- "headline": "Καλώς ήρθατε στην ιστοσελίδα μας",
420
- "text": "Αυτή η σελίδα εμφανίζεται προς το παρόν στα ${currentLabel}. Ωστόσο, προσφέρουμε επίσης αυτή τη σελίδα στην προτιμώμενη γλώσσα σας. Θα θέλατε να αλλάξετε;",
488
+ el: {
489
+ headline: "Καλώς ήρθατε στην ιστοσελίδα μας",
490
+ text: "Αυτή η σελίδα εμφανίζεται προς το παρόν στα ${currentLabel}. Ωστόσο, προσφέρουμε επίσης αυτή τη σελίδα στην προτιμώμενη γλώσσα σας. Θα θέλατε να αλλάξετε;",
421
491
  "button-label": "Αλλαγή σε ${preferred.label}",
422
492
  "button-no-thanks": "Όχι, ευχαριστώ",
423
- "headline-other": "Άλλες γλώσσες"
493
+ "headline-other": "Άλλες γλώσσες",
424
494
  },
425
- "hu": {
426
- "headline": "Üdvözöljük weboldalunkon",
427
- "text": "Ez az oldal jelenleg ${currentLabel} nyelven jelenik meg. Azonban kínáljuk ezt az oldalt a preferált nyelvén is. Szeretne váltani?",
495
+ hu: {
496
+ headline: "Üdvözöljük weboldalunkon",
497
+ text: "Ez az oldal jelenleg ${currentLabel} nyelven jelenik meg. Azonban kínáljuk ezt az oldalt a preferált nyelvén is. Szeretne váltani?",
428
498
  "button-label": "Váltás ${preferred.label} nyelvre",
429
499
  "button-no-thanks": "Nem, köszönöm",
430
- "headline-other": "További nyelvek"
500
+ "headline-other": "További nyelvek",
431
501
  },
432
- "ro": {
433
- "headline": "Bine ați venit pe site-ul nostru",
434
- "text": "Această pagină este afișată în prezent în ${currentLabel}. Totuși, oferim de asemenea această pagină în limba dumneavoastră preferată. Doriți să schimbați?",
502
+ ro: {
503
+ headline: "Bine ați venit pe site-ul nostru",
504
+ text: "Această pagină este afișată în prezent în ${currentLabel}. Totuși, oferim de asemenea această pagină în limba dumneavoastră preferată. Doriți să schimbați?",
435
505
  "button-label": "Schimbați în ${preferred.label}",
436
506
  "button-no-thanks": "Nu, mulțumesc",
437
- "headline-other": "Alte limbi"
507
+ "headline-other": "Alte limbi",
438
508
  },
439
- "da": {
440
- "headline": "Velkommen til vores hjemmeside",
441
- "text": "Denne side vises i øjeblikket på ${currentLabel}. Vi tilbyder dog også denne side på dit foretrukne sprog. Vil du skifte?",
509
+ da: {
510
+ headline: "Velkommen til vores hjemmeside",
511
+ text: "Denne side vises i øjeblikket på ${currentLabel}. Vi tilbyder dog også denne side på dit foretrukne sprog. Vil du skifte?",
442
512
  "button-label": "Skift til ${preferred.label}",
443
513
  "button-no-thanks": "Nej tak",
444
- "headline-other": "Andre sprog"
514
+ "headline-other": "Andre sprog",
445
515
  },
446
- "no": {
447
- "headline": "Velkommen til vår nettside",
448
- "text": "Denne siden vises for øyeblikket på ${currentLabel}. Vi tilbyr imidlertid også denne siden på ditt foretrukne språk. Ønsker du å bytte?",
516
+ no: {
517
+ headline: "Velkommen til vår nettside",
518
+ text: "Denne siden vises for øyeblikket på ${currentLabel}. Vi tilbyr imidlertid også denne siden på ditt foretrukne språk. Ønsker du å bytte?",
449
519
  "button-label": "Bytt til ${preferred.label}",
450
520
  "button-no-thanks": "Nei, takk",
451
- "headline-other": "Andre språk"
521
+ "headline-other": "Andre språk",
452
522
  },
453
- "hi": {
454
- "headline": "हमारी वेबसाइट पर आपका स्वागत है",
455
- "text": "यह पृष्ठ वर्तमान में ${currentLabel} में प्रदर्शित हो रहा है। हालांकि, हम इस पृष्ठ को आपकी पसंदीदा भाषा में भी प्रदान करते हैं। क्या आप स्विच करना चाहेंगे?",
523
+ hi: {
524
+ headline: "हमारी वेबसाइट पर आपका स्वागत है",
525
+ text: "यह पृष्ठ वर्तमान में ${currentLabel} में प्रदर्शित हो रहा है। हालांकि, हम इस पृष्ठ को आपकी पसंदीदा भाषा में भी प्रदान करते हैं। क्या आप स्विच करना चाहेंगे?",
456
526
  "button-label": "${preferred.label} में स्विच करें",
457
527
  "button-no-thanks": "नहीं, धन्यवाद",
458
- "headline-other": "अन्य भाषाएँ"
528
+ "headline-other": "अन्य भाषाएँ",
459
529
  },
460
- "bn": {
461
- "headline": "আমাদের ওয়েবসাইটে আপনাকে স্বাগতম",
462
- "text": "এই পৃষ্ঠাটি বর্তমানে ${currentLabel} প্রদর্শিত হচ্ছে। তবে, আমরা এই পৃষ্ঠাটি আপনার পছন্দের ভাষায়ও অফার করি। আপনি কি সুইচ করতে চান?",
530
+ bn: {
531
+ headline: "আমাদের ওয়েবসাইটে আপনাকে স্বাগতম",
532
+ text: "এই পৃষ্ঠাটি বর্তমানে ${currentLabel} প্রদর্শিত হচ্ছে। তবে, আমরা এই পৃষ্ঠাটি আপনার পছন্দের ভাষায়ও অফার করি। আপনি কি সুইচ করতে চান?",
463
533
  "button-label": "${preferred.label}-এ সুইচ করুন",
464
534
  "button-no-thanks": "না, ধন্যবাদ",
465
- "headline-other": "অন্যান্য ভাষাসমূহ"
535
+ "headline-other": "অন্যান্য ভাষাসমূহ",
466
536
  },
467
- "ta": {
468
- "headline": "எங்கள் இணையதளத்திற்கு வருக",
469
- "text": "இந்த பக்கம் தற்போது ${currentLabel} என்ற மொழியில் காட்சியளிக்கப்படுகிறது. எனினும், நாங்கள் இந்த பக்கத்தை உங்கள் விருப்ப மொழியிலும் வழங்குகிறோம். நீங்கள் மாற்ற விரும்புகிறீர்களா?",
537
+ ta: {
538
+ headline: "எங்கள் இணையதளத்திற்கு வருக",
539
+ text: "இந்த பக்கம் தற்போது ${currentLabel} என்ற மொழியில் காட்சியளிக்கப்படுகிறது. எனினும், நாங்கள் இந்த பக்கத்தை உங்கள் விருப்ப மொழியிலும் வழங்குகிறோம். நீங்கள் மாற்ற விரும்புகிறீர்களா?",
470
540
  "button-label": "${preferred.label}-க்கு மாற்றவும்",
471
541
  "button-no-thanks": "இல்லை, நன்றி",
472
- "headline-other": "மற்ற மொழிகள்"
542
+ "headline-other": "மற்ற மொழிகள்",
473
543
  },
474
- "te": {
475
- "headline": "మా వెబ్‌సైట్‌కు స్వాగతం",
476
- "text": "ఈ పేజీ ప్రస్తుతం ${currentLabel}లో ప్రదర్శితం అవుతున్నది. అయితే, మేము ఈ పేజీని మీ ఇష్టపడే భాషలో కూడా అందిస్తున్నాము. మీరు మార్చాలనుకుంటున్నారా?",
544
+ te: {
545
+ headline: "మా వెబ్‌సైట్‌కు స్వాగతం",
546
+ text: "ఈ పేజీ ప్రస్తుతం ${currentLabel}లో ప్రదర్శితం అవుతున్నది. అయితే, మేము ఈ పేజీని మీ ఇష్టపడే భాషలో కూడా అందిస్తున్నాము. మీరు మార్చాలనుకుంటున్నారా?",
477
547
  "button-label": "${preferred.label}కి మార్చండి",
478
548
  "button-no-thanks": "కాదు, ధన్యవాదాలు",
479
- "headline-other": "ఇతర భాషలు"
549
+ "headline-other": "ఇతర భాషలు",
480
550
  },
481
- "mr": {
482
- "headline": "आपले आमच्या वेबसाइटवर स्वागत आहे",
483
- "text": "हे पान सध्या ${currentLabel}मध्ये दाखविले जात आहे. परंतु, आम्ही हे पान आपल्या पसंतीच्या भाषेतही देत आहोत. आपण स्विच करू इच्छिता का?",
551
+ mr: {
552
+ headline: "आपले आमच्या वेबसाइटवर स्वागत आहे",
553
+ text: "हे पान सध्या ${currentLabel}मध्ये दाखविले जात आहे. परंतु, आम्ही हे पान आपल्या पसंतीच्या भाषेतही देत आहोत. आपण स्विच करू इच्छिता का?",
484
554
  "button-label": "${preferred.label}मध्ये स्विच करा",
485
555
  "button-no-thanks": "नाही, धन्यवाद",
486
- "headline-other": "इतर भाषा"
556
+ "headline-other": "इतर भाषा",
487
557
  },
488
- "zh": {
489
- "headline": "欢迎访问我们的网站",
490
- "text": "本页面当前显示为${currentLabel}。然而,我们还提供您偏好的语言版本。您想切换吗?",
558
+ zh: {
559
+ headline: "欢迎访问我们的网站",
560
+ text: "本页面当前显示为${currentLabel}。然而,我们还提供您偏好的语言版本。您想切换吗?",
491
561
  "button-label": "切换到${preferred.label}",
492
562
  "button-no-thanks": "不,谢谢",
493
- "headline-other": "其他语言"
563
+ "headline-other": "其他语言",
494
564
  },
495
- "ja": {
496
- "headline": "私たちのウェブサイトへようこそ",
497
- "text": "このページは現在${currentLabel}で表示されています。しかし、私たちはあなたの好みの言語でこのページを提供しています。切り替えますか?",
565
+ ja: {
566
+ headline: "私たちのウェブサイトへようこそ",
567
+ text: "このページは現在${currentLabel}で表示されています。しかし、私たちはあなたの好みの言語でこのページを提供しています。切り替えますか?",
498
568
  "button-label": "${preferred.label}に切り替える",
499
569
  "button-no-thanks": "いいえ、結構です",
500
- "headline-other": "他の言語"
501
- }
502
- }
570
+ "headline-other": "他の言語",
571
+ },
572
+ };
503
573
 
504
574
  const selectAnOption = {
505
- "en": "Select a language",
506
- "de": "Wählen Sie eine Sprache",
507
- "fr": "Sélectionnez une langue",
508
- "es": "Seleccione un idioma",
509
- "it": "Seleziona una lingua",
510
- "pt": "Selecione um idioma",
511
- "nl": "Selecteer een taal",
512
- "pl": "Wybierz język",
513
- "ru": "Выберите язык",
514
- "cs": "Vyberte jazyk",
515
- "sk": "Vyberte jazyk",
516
- "bg": "Изберете език",
517
- "hr": "Odaberite jezik",
518
- "fi": "Valitse kieli",
519
- "sv": "Välj ett språk",
520
- "el": "Επιλέξτε γλώσσα",
521
- "hu": "Válasszon egy nyelvet",
522
- "ro": "Selectați o limbă",
523
- "da": "Vælg et sprog",
524
- "no": "Velg et språk",
525
- "hi": "एक भाषा चुनें",
526
- "bn": "একটি ভাষা নির্বাচন করুন",
527
- "ta": "ஒரு மொழியைத் தேர்ந்தெடுக்கவும்",
528
- "te": "భాషను ఎంచుకోండి",
529
- "mr": "एक भाषा निवडा",
530
- "zh": "选择一种语言",
531
- "ja": "言語を選択してください"
575
+ en: "Select a language",
576
+ de: "Wählen Sie eine Sprache",
577
+ fr: "Sélectionnez une langue",
578
+ es: "Seleccione un idioma",
579
+ it: "Seleziona una lingua",
580
+ pt: "Selecione um idioma",
581
+ nl: "Selecteer een taal",
582
+ pl: "Wybierz język",
583
+ ru: "Выберите язык",
584
+ cs: "Vyberte jazyk",
585
+ sk: "Vyberte jazyk",
586
+ bg: "Изберете език",
587
+ hr: "Odaberite jezik",
588
+ fi: "Valitse kieli",
589
+ sv: "Välj ett språk",
590
+ el: "Επιλέξτε γλώσσα",
591
+ hu: "Válasszon egy nyelvet",
592
+ ro: "Selectați o limbă",
593
+ da: "Vælg et sprog",
594
+ no: "Velg et språk",
595
+ hi: "एक भाषा चुनें",
596
+ bn: "একটি ভাষা নির্বাচন করুন",
597
+ ta: "ஒரு மொழியைத் தேர்ந்தெடுக்கவும்",
598
+ te: "భాషను ఎంచుకోండి",
599
+ mr: "एक भाषा निवडा",
600
+ zh: "选择一种语言",
601
+ ja: "言語を選択してください",
532
602
  };
533
603
 
534
- const result = {}
604
+ const result = {};
535
605
 
536
606
  if (map[lang]) {
537
- result['labels'] = map[lang];
607
+ result["labels"] = map[lang];
538
608
  } else {
539
- result['labels'] = map['en'];
609
+ result["labels"] = map["en"];
540
610
  }
541
611
 
542
612
  if (selectAnOption[lang]) {
543
- result['selectAnOption'] = selectAnOption[lang];
613
+ result["selectAnOption"] = selectAnOption[lang];
544
614
  } else {
545
- result['selectAnOption'] = selectAnOption['en'];
615
+ result["selectAnOption"] = selectAnOption["en"];
546
616
  }
547
617
 
548
618
  return result;
549
-
550
-
551
619
  }
552
620
 
553
621
  /**
@@ -560,21 +628,18 @@ function initControlReferences() {
560
628
  );
561
629
 
562
630
  this[otherLanguagesElementSymbol] = this.shadowRoot.querySelector(
563
- `[${ATTRIBUTE_ROLE}="other-languages"]`
631
+ `[${ATTRIBUTE_ROLE}="other-languages"]`,
564
632
  );
565
633
 
566
634
  this[buttonNoThanksElementSymbol] = this.shadowRoot.querySelector(
567
- `[${ATTRIBUTE_ROLE}="button-no-thanks"]`
635
+ `[${ATTRIBUTE_ROLE}="button-no-thanks"]`,
568
636
  );
569
637
 
570
638
  this[buttonLanguageElementSymbol] = this.shadowRoot.querySelector(
571
- `[${ATTRIBUTE_ROLE}="button-language"]`
639
+ `[${ATTRIBUTE_ROLE}="button-language"]`,
572
640
  );
573
-
574
-
575
641
  }
576
642
 
577
-
578
643
  /**
579
644
  * @private
580
645
  * @return {string}