aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/menu
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2023-05-24 16:48:54 +0200
committerChocobozzz <me@florianbigard.com>2023-05-24 16:56:05 +0200
commit54909304287f3c04dcfb39660be8ead57dc95440 (patch)
tree478f1b913f3bd4c3bbaa17525f0114c5b0a8689d /client/src/app/menu
parentd0fbc9fd0a29c37f3ff9b99030351e90b276fe7d (diff)
downloadPeerTube-54909304287f3c04dcfb39660be8ead57dc95440.tar.gz
PeerTube-54909304287f3c04dcfb39660be8ead57dc95440.tar.zst
PeerTube-54909304287f3c04dcfb39660be8ead57dc95440.zip
Remove suppressImplicitAnyIndexErrors
It's deprecated by TS
Diffstat (limited to 'client/src/app/menu')
-rw-r--r--client/src/app/menu/language-chooser.component.ts7
1 files changed, 4 insertions, 3 deletions
diff --git a/client/src/app/menu/language-chooser.component.ts b/client/src/app/menu/language-chooser.component.ts
index b42e41855..f7ae69717 100644
--- a/client/src/app/menu/language-chooser.component.ts
+++ b/client/src/app/menu/language-chooser.component.ts
@@ -1,6 +1,7 @@
1import { Component, ElementRef, Inject, LOCALE_ID, ViewChild } from '@angular/core' 1import { Component, ElementRef, Inject, LOCALE_ID, ViewChild } from '@angular/core'
2import { getDevLocale, isOnDevLocale, sortBy } from '@app/helpers' 2import { getDevLocale, isOnDevLocale, sortBy } from '@app/helpers'
3import { NgbModal } from '@ng-bootstrap/ng-bootstrap' 3import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
4import { objectKeysTyped } from '@shared/core-utils'
4import { getCompleteLocale, getShortLocale, I18N_LOCALES } from '@shared/core-utils/i18n' 5import { getCompleteLocale, getShortLocale, I18N_LOCALES } from '@shared/core-utils/i18n'
5 6
6@Component({ 7@Component({
@@ -17,8 +18,8 @@ export class LanguageChooserComponent {
17 private modalService: NgbModal, 18 private modalService: NgbModal,
18 @Inject(LOCALE_ID) private localeId: string 19 @Inject(LOCALE_ID) private localeId: string
19 ) { 20 ) {
20 const l = Object.keys(I18N_LOCALES) 21 const l = objectKeysTyped(I18N_LOCALES)
21 .map(k => ({ id: k, label: I18N_LOCALES[k], iso: getShortLocale(k) })) 22 .map(k => ({ id: k, label: I18N_LOCALES[k], iso: getShortLocale(k) }))
22 23
23 this.languages = sortBy(l, 'label') 24 this.languages = sortBy(l, 'label')
24 } 25 }
@@ -35,7 +36,7 @@ export class LanguageChooserComponent {
35 const english = 'English' 36 const english = 'English'
36 const locale = isOnDevLocale() ? getDevLocale() : getCompleteLocale(this.localeId) 37 const locale = isOnDevLocale() ? getDevLocale() : getCompleteLocale(this.localeId)
37 38
38 if (locale) return I18N_LOCALES[locale] || english 39 if (locale) return I18N_LOCALES[locale as keyof typeof I18N_LOCALES] || english
39 return english 40 return english
40 } 41 }
41} 42}