Round 3 of Bugfixing (#3318)
This commit is contained in:
parent
727fbd353b
commit
abdf15b895
40 changed files with 482 additions and 489 deletions
|
|
@ -9,16 +9,10 @@ import {shareReplay} from "rxjs/operators";
|
|||
})
|
||||
export class LanguageNamePipe implements PipeTransform {
|
||||
|
||||
constructor(private metadataService: MetadataService) {
|
||||
}
|
||||
constructor(private metadataService: MetadataService) {}
|
||||
|
||||
transform(isoCode: string): Observable<string> {
|
||||
// TODO: See if we can speed this up. It rarely changes and is quite heavy to download on each page
|
||||
return this.metadataService.getAllValidLanguages().pipe(map(lang => {
|
||||
const l = lang.filter(l => l.isoCode === isoCode);
|
||||
if (l.length > 0) return l[0].title;
|
||||
return '';
|
||||
}), shareReplay());
|
||||
return this.metadataService.getLanguageNameForCode(isoCode).pipe(shareReplay());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue