From 5411863f6a00071201dd50dc6d2f33477e6ffb29 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Sat, 19 Aug 2023 23:51:48 -0700 Subject: [PATCH] Fixed: Unknown audio language appearing as 'root' Closes #5602 --- frontend/src/EpisodeFile/MediaInfo.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/frontend/src/EpisodeFile/MediaInfo.js b/frontend/src/EpisodeFile/MediaInfo.js index 59f6ffcfd..bcf196469 100644 --- a/frontend/src/EpisodeFile/MediaInfo.js +++ b/frontend/src/EpisodeFile/MediaInfo.js @@ -2,6 +2,7 @@ import _ from 'lodash'; import PropTypes from 'prop-types'; import React from 'react'; import getLanguageName from 'Utilities/String/getLanguageName'; +import translate from 'Utilities/String/translate'; import * as mediaInfoTypes from './mediaInfoTypes'; function formatLanguages(languages) { @@ -9,7 +10,16 @@ function formatLanguages(languages) { return null; } - const splitLanguages = _.uniq(languages.split('/')).map((l) => getLanguageName(l.split('_')[0])); + const splitLanguages = _.uniq(languages.split('/')).map((l) => { + const simpleLanguage = l.split('_')[0]; + + if (simpleLanguage === 'und') { + return translate('Unknown'); + } + + return getLanguageName(simpleLanguage); + } + ); if (splitLanguages.length > 3) { return (