Suspected incorrect locale picking first (incorrect) Portuguese subtitles (BUG)

Server Version#: 1.42.2.10156 (but this has been happening for a long time).
Player Version#: reproduced on the latest tvOS (can add version later, not handy right now).

TL;DR:

  • I suspect it has to do with the locale without region definition which defaults to picking the first subtitle matching the language even if there is another more pertinent subtitle (details in the last section)

Reproduction steps

  1. On the Apple TV, start playing media which contains Portuguese Brazilian and Portuguese subtitles (pt_BR and pt_PT respectively).
  2. Using Apple TV’s remote, press down on the wheel to show the drop down menu, navigate to the 2nd tab and the subtitles section.
  3. Note that there are two “Portuguese” entries.

You don’t know which one of the entries corresponds to which but based on my experience with this issue and understanding how alphabetical ordering works, the first is the pt_BR and the second is pt_PT.

This is even more problematic for non-tech savvy folks which have their accounts set to Portuguese (from Portugal, as in pt_PT) and get pt_BR subtitles.

On iOS and the Web clients show the actual version however I didn’t try with an account set with the language on these clients: beneath the first instance of the “Portuguese” subtitle, it says “Brazilian” making it unequivocally clear that the second is Portuguese from Portugal.

Mitigation proposal

I understand the space limitation on the tvOS UI to display another line of text but would it be possible to select the right subtitle based on the user’s configured subtitle settings? For example, if the user has Portuguese (Portugal) selected as the default, even if the tvOS doesn’t display the subtitle, would it be possible to select the correct one?

Understanding what info is available to PMS in terms of embedded subtitles

Using some suggestions from an LLM, I checked what the media file contains. My concern was: what if it doesn’t know which one it is? But it doesn’t make sense because the iOS and the Web clients know because PMS knows.

❯ ffprobe -v quiet -show_streams -select_streams s media.mkv | less | grep -A 1 "language=por"
TAG:language=por
TAG:title=Brazilian
--
TAG:language=por
TAG:BPS=77

So, the problem of the selection of the subtitles must be either in tvOS or there’s an issue with the default settings.

Understanding the default language settings

Spoiler: found something strange.

In the settings page (https://app.plex.tv/desktop/#!/settings/account), for this user’s account, under Settings (Definições), Language (Idioma) there are 3 entries (why 3?!):

  1. Português
  2. Português (Brasil)
  3. Português Brasileiro

Inspecting the page, the values associated with those are:

<option value="pt">Português</option>
<option value="pb">Português (Brasil)</option>
<option value="pt-BR">Português Brasileiro</option>

pt and pt-BR make sense but “pb” is interesting…

In the same account settings page, we can set the preferred subtitle language (Idioma de legendas preferido) and that’s where the plot thickens. Inspecting the drop down, we see the same “pb” for both default audio and default subtitles:

<option value="pt">Português</option>
<option value="pb">Português (Brasil)</option>

Locales: pt, pt_PT, and pt_BR (and the actual solution to the problem?)

Assuming the regular locales with the language (e.g., pt) ISO 639-1 and region (e.g., BR) ISO 3366-1 alpha 2, then my interpretation is the following:

Since the language settings in the account settings page defines the language as merely “pt” for Portuguese (Português), my understanding is that lacking the region (e.g., PT), it assumes “any Portuguese language works”. Since the metadata of the media file contains pt_BR first, it matches the requirement and plays.

Therefore, the optimal solution would be to add a new entry “Português (Portugal)” with the specific locale as value “pt-PT” and, obviously, do the heavy lifting in PMS and the clients.

This allows users without preference to get any Portuguese subtitles (from Portugal or Brazil) and others to restrict to the region they wish. Adding an option to prioritize them seems overkill to me.

Would it be possible for you to fix this issue? Pretty please with a cherry on top? :slight_smile:

Hi, I use Plex with English audio and Spanish subtitles. Unfortunately, I can’t reproduce, as I don’t have any media with portuguese audio / subtitles, and both spanish and latinoamerican spanish is treated as the same language inside preferred subtitle language, just “Spanish”.

What I can suggest as a workaround is disabling automatically choosing subtitles. The user (even non-tech savvy folk), just has to choose a subtitle at the start of a movie or series. We’ve been using it this way and it works most of the time, it searchs openSRT automatically, and you can choose the SRT to add.