We have an API hosted on Optimizely 12, which we call from our Javascript frontend. In general it works just fine. However culture is not set correctly in our API Controller. When looking at Thread.CurrentThread.CurrentUICulture, we can see that culture is "en". We have not enabled "en" on our Optimizely site, but instead we have enabled "en-US" for different reasons.
How are you handling language and culture in your API calls?
I have found this thread in the forum, but as far as I can see, it never reached an answer:
It looks as if the Optimizely Content Delivery API relies on the Accept-Language header being set correctly. I think that is a good option, and we have tried to set this header in our API calls. It is not picked up automatically by our API Controller.
How do I programatically set language in a way that Optimizely accepts?
Hi all
We have an API hosted on Optimizely 12, which we call from our Javascript frontend. In general it works just fine. However culture is not set correctly in our API Controller. When looking at Thread.CurrentThread.CurrentUICulture, we can see that culture is "en". We have not enabled "en" on our Optimizely site, but instead we have enabled "en-US" for different reasons.
How are you handling language and culture in your API calls?
I have found this thread in the forum, but as far as I can see, it never reached an answer:
https://world.optimizely.com/forum/developer-forum/cms-12/thread-container/2022/9/best-practice-for-fetching-language-context-in-an-api-controller/
It looks as if the Optimizely Content Delivery API relies on the Accept-Language header being set correctly. I think that is a good option, and we have tried to set this header in our API calls. It is not picked up automatically by our API Controller.
How do I programatically set language in a way that Optimizely accepts?
Thank you for your help.
Regards
Anders