1
0
Fork 0

Added "zxx" (no linguistic content) in available video languages (#4631)

* Added "zxx" (no linguistic content) in available video languages

Implements https://github.com/Chocobozzz/PeerTube/issues/1489

* FIx lint

* Fix lint

* Put other languages below instance languages

Co-authored-by: Chocobozzz <me@florianbigard.com>
This commit is contained in:
Florian CUNY 2021-12-13 15:32:14 +01:00 committed by GitHub
parent a37e9e74ff
commit 81547acb25
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View file

@ -178,9 +178,11 @@ export class VideoEditComponent implements OnInit, OnDestroy {
.subscribe(res => { .subscribe(res => {
this.videoLanguages = res.languages this.videoLanguages = res.languages
.map(l => { .map(l => {
if (l.id === 'zxx') return { ...l, group: $localize`Other`, groupOrder: 1 }
return res.about.instance.languages.includes(l.id) return res.about.instance.languages.includes(l.id)
? { ...l, group: $localize`Instance languages`, groupOrder: 0 } ? { ...l, group: $localize`Instance languages`, groupOrder: 0 }
: { ...l, group: $localize`All languages`, groupOrder: 1 } : { ...l, group: $localize`All languages`, groupOrder: 2 }
}) })
.sort((a, b) => a.groupOrder - b.groupOrder) .sort((a, b) => a.groupOrder - b.groupOrder)
}) })

View file

@ -1075,7 +1075,9 @@ function buildLanguages () {
epo: true, // Esperanto epo: true, // Esperanto
tlh: true, // Klingon tlh: true, // Klingon
jbo: true, // Lojban jbo: true, // Lojban
avk: true // Kotava avk: true, // Kotava
zxx: true // No linguistic content (ISO-639-2)
} }
// Only add ISO639-1 languages and some sign languages (ISO639-3) // Only add ISO639-1 languages and some sign languages (ISO639-3)