Forum Discussion

erickutcher's avatar
erickutcher
Reel Rookie
2 years ago
Solved

GetPreferredCaptionLanguage() returning ISO 639-1 language code rather than ISO 639-2.

I tested this on my Roku 3.

It's giving me back a 2-letter language code rather than a 3-letter language code.

Is the API wrong, or the documents?

4 Replies

    • RokuBen's avatar
      RokuBen
      Community Moderator

      Yes, this API ended up changing in Roku OS 12.0 -- there was some inconsistency that broke internal testing, and the fix was made to always use the two-character codes, but the docs weren't updated.

      • erickutcher's avatar
        erickutcher
        Reel Rookie

        So if I want to compare the Language key in a video's availableSubtitleTracks array, I'm going to have to use an internal mapping of 2-letter codes to 3-letter codes?

        Are the preferred caption languages listed in the docs all of the supported languages?