Strapi + Multilingual : use the language value

Hi @dejan : I would like to use the Strapi capability to return content using the “locale” API parameter.

see Internationalization (i18n) | Strapi Documentation

is it possible to automatically add something like “$current_language_code)” ?

Can you tell me also what should I configure into my REST API calls for this local parameter as I don’t know how I can get the current active local in the divhunt page (should be lowercased)


I will need to research this a bit, but we will add it for sure :slight_smile:

1 Like

what is the parameter I can use for my Rest API parameter ? $language->get(‘active’) ?

This is not working


Sorry, can you give me domain again? I can’t keep track of all domains, I’ll check

It is

I’ve made it work, but I need to improve this system. The issue here was that toLowerCase did not exist at all because this was back-end processed.

So we need to also create all back-end functions too that are in front-end.

1 Like

@dejan The toLowerCase could be not necessary is in the language config we could specify a lowcase value or have a lowercase (standard) value at hand in the variables.

I’ve started my Strapi server for you to do tests if necessary.

What are the urls to change languages ? Is there a dedicated component to be able to switch languages wherever we are and targeting the page we are currently displaying ?

@dejan : can you help me for setting correctly the “locale” param on my REST API to call strapi ( ?


I’ll see this one tomorrow. Thanks for patience.

1 Like

@dejan : I’ve started my server and I’m ready to test


I’m a bit later, but I can help now.
As I can currently see, it already sends it correctly? What is the issue here?

Can you share more information, so we can fix it :slight_smile:

Hi @dejan, thanks for your patience with me.
I didn’t noticed it was working because I didn’t do some work my side.
Now done and work like a charm.

Then, my only missing point is the switch between languages, but it’s already a discussion we have somewhere else, let’s close this one :wink:

@dejan similarly to “populate” strapi param, the locale should probably appear here:

To clarify : in Strapi, you can have entries associated with language. Ex. Articles, some are in french, some in english and some with versions for both languages.

Thus, when the “locale=en” parameter is used, only entries with an english version is returned.

In your request, you’ve set Divhunt system language to be passed to Strapi, so it’s automatic.

If you want manually to have property inside builder and choose language, then you need inside request to create new Dynamic Property called “locale” and then you’ll be able to manually pass locale.

As for Strapi plugin, I’ll add that soon - or should we also do automatic?

To me it makes sense to be automatic.
However, I’ve not an extensive view of Strapi use cases: is it possible to have a configuration in the plugin where you say "automatically add the locale parameter ?


What if we add property “locale” with predefined value: $language->get(‘active’)->toLowerCase

Then it’s automatic if you don’t change, otherwise you can change to whatever you want.

yes that’s perfect !


I’ve added it, let me know if it works as expected?

1 Like

Thanks @dejan, yes it’s working as expected!

1 Like