[PR #16151] [MERGED] Fix TMDB language handling: support full ISO 639-1 + ISO 3166-1 codes (e.g. zh-CN, zh-TW) #14542

Closed
opened 2026-02-07 07:31:31 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/jellyfin/jellyfin/pull/16151
Author: @Daydreamer-riri
Created: 2/1/2026
Status: Merged
Merged: 2/2/2026
Merged by: @Bond-009

Base: masterHead: tmdb-lang


📝 Commits (1)

  • 7b10888 Remove handling for 5-letter language codes in TMDb language normalization

📊 Changes

1 file changed (+0 additions, -8 deletions)

View changed files

📝 MediaBrowser.Providers/Plugins/Tmdb/TmdbUtils.cs (+0 -8)

📄 Description

Currently, Jellyfin’s TmdbUtils.cs contains the following logic:

if (preferredLanguage.Length == 5) // Like en-US
{
    // Currently, TMDb supports 2-letter language codes only.
    // They are planning to change this in the future, thus we're
    // supplying both codes if we're having a 5-letter code.
    languages.Add(preferredLanguage.Substring(0, 2));
}

This code truncates full language-region codes such as zh-CN or en-US into two-letter language codes (zh, en).
However, TMDB now officially supports full ISO 639-1 + ISO 3166-1 combinations (e.g. zh-CN, zh-TW, pt-BR). See https://developer.themoviedb.org/docs/languages

Problem

When users set zh-CN in Jellyfin, the TMDB plugin sends zh instead.

This causes TMDB to return Traditional Chinese resources instead of Simplified Chinese.

The issue has been reported (see Issue #16069).

Changes

Removed the truncation logic for 5-character language codes.

Full xx-YY language-region codes are now passed directly to TMDB.

Two-letter language codes (e.g. en) continue to work as before.

Impact

Only affects TMDB plugin language handling.

No impact on other metadata providers.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/jellyfin/jellyfin/pull/16151 **Author:** [@Daydreamer-riri](https://github.com/Daydreamer-riri) **Created:** 2/1/2026 **Status:** ✅ Merged **Merged:** 2/2/2026 **Merged by:** [@Bond-009](https://github.com/Bond-009) **Base:** `master` ← **Head:** `tmdb-lang` --- ### 📝 Commits (1) - [`7b10888`](https://github.com/jellyfin/jellyfin/commit/7b10888c95c814af342926269403b93677760042) Remove handling for 5-letter language codes in TMDb language normalization ### 📊 Changes **1 file changed** (+0 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `MediaBrowser.Providers/Plugins/Tmdb/TmdbUtils.cs` (+0 -8) </details> ### 📄 Description Currently, Jellyfin’s TmdbUtils.cs contains the following logic: ```csharp if (preferredLanguage.Length == 5) // Like en-US { // Currently, TMDb supports 2-letter language codes only. // They are planning to change this in the future, thus we're // supplying both codes if we're having a 5-letter code. languages.Add(preferredLanguage.Substring(0, 2)); } ``` This code truncates full language-region codes such as zh-CN or en-US into two-letter language codes (zh, en). However, TMDB now officially supports full ISO 639-1 + ISO 3166-1 combinations (e.g. zh-CN, zh-TW, pt-BR). See https://developer.themoviedb.org/docs/languages ## Problem When users set zh-CN in Jellyfin, the TMDB plugin sends zh instead. This causes TMDB to return Traditional Chinese resources instead of Simplified Chinese. The issue has been reported (see Issue #16069). ## Changes Removed the truncation logic for 5-character language codes. Full xx-YY language-region codes are now passed directly to TMDB. Two-letter language codes (e.g. en) continue to work as before. ## Impact Only affects TMDB plugin language handling. No impact on other metadata providers. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2026-02-07 07:31:31 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/jellyfin#14542