Assistance de TMDB

Hi, great to see you provide a forum for question. Thanks in advance for any answers, and I hope I am not too confusing

Question: I am somewhat confused by the language / region difference and mainly how the language parameter can or should be specified.

I see that the default for the language parameter is 1. 1. en-US. However, when I use the languages endpoint (https://developer.themoviedb.org/reference/configuration-languages), I only get a list of two-letter language codes (en, de, ...), as expected from ISO-639-1.

What effect does the region part in the language code have? And can I make a valid API request using only the two-letter language code?

My use case comes from validating language and region codes in my application before sending them. I could validate language and region separately and then combine them, but this would allow non-existing combinations like pl-US etc.

Can I just send the two-letter language code, and the region parameter separately, would this affect the response?

And if not, is there and way I can get the list of these combined codes like "en-US" for validation?


Thank you, Alex

1 réponse (sur la page 1 sur 1)

Jump to last post

@MovR0R1 said:
Language codes vs. region
Hi,
great to see you provide a forum for question.
Thanks in advance for any answers, and I hope I am not too confusing

Question:
I am somewhat confused by the language / region difference and mainly how the language parameter can or should be specified.

I advise using ISO-639-1 + ISO-3166-1, the language and the country.

I see that the default for the language parameter is 1. 1. en-US.
However, when I use the languages endpoint (https://developer.themoviedb.org/reference/configuration-languages),
I only get a list of two-letter language codes (en, de, ...), as expected from ISO-639-1.

Maybe this list will help.
https://developer.themoviedb.org/reference/configuration-primary-translations

What effect does the region part in the language code have?

Some time ago users asked to add the country because despite the same language the local title was different.
For example pt-PT and pt-BR.
There are many films with different titles between Portugal and Brazil.
Furthermore, the language is the same but with several different word usage characteristics.
What impacts the Overview.
See the list in the link above for the various countries with the same language.
And some countries with multiple languages.
India, for example, has 5 languages, I think.
Canada has 2 languages, English and French.

Today images only receive the language.
It is planned to use language-COUNTRY.

And can I make a valid API request using only the two-letter language code?

If you use only the language you will receive the default Language-Country data (title, overview).
In the case of pt you will receive pt-PT, from Portugal.
I believe that in the case of en you will receive it from en-US, from the USA.
And if I remember correctly, in some Requests it can cause some problems.

My use case comes from validating language and region codes in my application before sending them.
I could validate language and region separately and then combine them, but this would allow non-existing combinations like pl-US etc.

Can I just send the two-letter language code, and the region parameter separately, would this affect the response?

I don't think so.
An API Request must contain the parameter.
I don't know how to split the parameter into two parts in the same API Request.
There is a separate Region parameter but, if I remember correctly, it affects specific cases like premiere dates.

And if not, is there and way I can get the list of these combined codes like "en-US" for validation?

In the link I posted above.
https://developer.themoviedb.org/reference/configuration-primary-translations
I don't think this list covers all the language-COUNTRY options in the world.
But it should solve 98% of the problems.

What we have in lists today:

  • 187 Languages
  • 251 Countries
  • 140 Primary Translations

Un film, une émission télévisée ou un artiste est introuvable ? Connectez-vous afin de créer une nouvelle fiche.

Général

s Mettre le curseur dans la barre de recherche
p Ouvrir le menu du profil
esc Fermer une fenĂŞtre ouverte
? Ouvrir la fenĂŞtre des raccourcis clavier

Sur les pages des médias

b Retour (ou vers le parent si faisable)
e Afficher la page de modification

Sur les pages des saisons des émissions télévisées

Afficher la saison suivante (flèche droite)
Afficher la saison précédente (flèche gauche)

Sur les pages des épisodes des émissions télévisées

Afficher l'épisode suivant (flèche droite)
Afficher l'épisode précédent (flèche gauche)

Sur toutes les pages des images / photos

a Ouvrir la fenĂŞtre d'ajout d'image / photo

Sur toutes les pages de modifications

t Ouvrir le sélecteur de traduction
ctrl+ s Envoyer le formulaire

Sur les pages des discussions

n Créer une nouvelle discussion
w Basculer le statut de suivi
p Basculer publique / privée
c Basculer fermer / ouvrir
a Ouvrir l'activité
r Répondre à la discussion
l Afficher la dernière réponse
ctrl+ enter Envoyer votre message
Page suivante (flèche droite)
Page précédente (flèche gauche)

Paramètres

Vous souhaitez évaluer ou ajouter cet élément à une liste ?

Connexion