How to combine populate and locale in REST API queries

System Information
  • Strapi Version: 4.5.2
  • Operating System: Windows 11
  • Database: Postgresql
  • Node Version: 18.7.0
  • NPM Version: 8.15.0
  • Yarn Version: —

Hi all,

I’d like to combine queries to the REST API using populate and locale at the same time. Separately they work as expected, e.g.

https://strapi-test-app.herokuapp.com/api/themes/1?populate=*

for populate and

https://strapi-test-app.herokuapp.com/api/themes/1?locale=en

for using locale (but then of course without related data).

When I try to combine both, e.g. like below, it doesn’t work (i.e. all available locales are returned for the first level data and only the default locale for the related data - in fact, the data is the same as what I get from just using populate=*):

https://strapi-test-app.herokuapp.com/api/themes/1?populate=*&?locale=en

Getting the related data in the default rather than the requested language is not useful :frowning:

2 Likes

I was facing the same issue, try appending your query parameters this way:

https://strapi-test-app.herokuapp.com/api/themes/1?locale=en&populate=*

Thank you for the suggestion, but this returns exactly the same result (and is also what I’d expect).

1 Like

Has anyone found a solution yet? I’m currently facing the same problem and no combination of parameters seems to work.

Same here! We have a collection type without localization enabled and a relational collection type including locale and I can’t set the locale of the populated relation