diff options
author | Chocobozzz <me@florianbigard.com> | 2023-05-24 16:48:54 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2023-05-24 16:56:05 +0200 |
commit | 54909304287f3c04dcfb39660be8ead57dc95440 (patch) | |
tree | 478f1b913f3bd4c3bbaa17525f0114c5b0a8689d /client/src/app/menu | |
parent | d0fbc9fd0a29c37f3ff9b99030351e90b276fe7d (diff) | |
download | PeerTube-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.ts | 7 |
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 @@ | |||
1 | import { Component, ElementRef, Inject, LOCALE_ID, ViewChild } from '@angular/core' | 1 | import { Component, ElementRef, Inject, LOCALE_ID, ViewChild } from '@angular/core' |
2 | import { getDevLocale, isOnDevLocale, sortBy } from '@app/helpers' | 2 | import { getDevLocale, isOnDevLocale, sortBy } from '@app/helpers' |
3 | import { NgbModal } from '@ng-bootstrap/ng-bootstrap' | 3 | import { NgbModal } from '@ng-bootstrap/ng-bootstrap' |
4 | import { objectKeysTyped } from '@shared/core-utils' | ||
4 | import { getCompleteLocale, getShortLocale, I18N_LOCALES } from '@shared/core-utils/i18n' | 5 | import { 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 | } |