Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
erickutcher
Reel Rookie

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

Jump to solution

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?

0 Kudos
1 Solution

Accepted Solutions
RokuBen
Community Moderator
Community Moderator

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

Jump to solution

The two-letter codes should match ISO 639-1. and the set of supported languages should match the docs, as we've not added any additional fonts for other character forms.

(https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes)

View solution in original post

0 Kudos
4 REPLIES 4
renojim
Community Streaming Expert

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

Jump to solution

I see the same thing on my 4800 and 3910 both on 12.5.  Maybe @RokuBen or @RokuKC could look into it.

Roku Community Streaming Expert

Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.

I am not a Roku employee.
0 Kudos
RokuBen
Community Moderator
Community Moderator

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

Jump to solution

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.

0 Kudos
erickutcher
Reel Rookie

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

Jump to solution

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?

0 Kudos
RokuBen
Community Moderator
Community Moderator

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

Jump to solution

The two-letter codes should match ISO 639-1. and the set of supported languages should match the docs, as we've not added any additional fonts for other character forms.

(https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes)

0 Kudos