I'm using the latest Strapi version (4.5.2) and have two locales configured:
https://my-api-url.com/api/i18n/locales ->
0
id 2
name "German (de)"
code "de"
createdAt "2022-11-23T17:15:52.629Z"
updatedAt "2022-11-23T19:58:50.165Z"
isDefault false
1
id 1
name "English (en)"
code "en"
createdAt "2022-11-22T14:31:35.679Z"
updatedAt "2022-11-23T19:59:05.421Z"
isDefault true
When I query my Strapi API without specifying a locale parameter, it should return the content in the default language (here, as shown above, "English"), but it doesn't:
https://my-api-url.com/api/mycollection ->
data []
meta
pagination
page 1
pageSize 25
pageCount 0
total 0
Querying with locale set to "German", I get the expected contents:
https://razor-server-tim.herokuapp.com/api/themes?locale=de ->
data
0
id 2
attributes
Title "Das ist mein Titel"
Summary "Das ist die Zusammenfassung"
SomeOtherField "Deutsche Übersetzung"
createdAt "2022-11-23T19:41:11.527Z"
updatedAt "2022-11-23T19:41:21.162Z"
publishedAt "2022-11-23T19:41:21.156Z"
ImageUrl "https://res.cloudinary.com/hnraymasy/image/upload/v1669146049/car_vxhq7h.png"
locale "de"
meta
pagination
page 1
pageSize 25
pageCount 1
total 1
Querying the API with locale=all results in only the German translations being returned.
(From the docs: "Use all as a value for the locale code, as in http://localhost:1337/api/restaurants?locale=all, to fetch entries for all locales that have been configured in the admin panel.)
In the Global Settings, the i18n plugin is configured as shown:
The collection type page shows that both locales have content available:
The entry itself also shows that English content is available:
Why does the API not return my English content?



