AWS Lambda does not recognize .net core culture

I am developing a simple lambda function with a .net kernel. For this I use AWS takeit.

My project has a file with three resources, one with a default message, and two with a greeting in Italian and French.

To do this, my function receives the query string parameter, and depending on this value, I set the culture for the current thread.

If I run this project using the unit test project, everything works fine, but when it runs on the Amazon infrastructure, it shows a default message. As if it never changes the default mainstream culture.

I am changing the current culture as follows:

CultureInfo.CurrentCulture = new CultureInfo("fr"); CultureInfo.CurrentUICulture = new CultureInfo("fr"); 

You can also check this url , which points to the api gateway endpoint, which uses my lambda function; where 1 is French, 2 is Italian, and another meaning is disjoint.

I created a github sample project to reproduce this behavior

Any idea on how to fix this? I want to send a localized message from my API. Maybe a different approach?

Thanks a lot!

UPDATE

The AWS Forum says resources are not yet supported! I created a problem in github AWS repo.

+5
source share

Source: https://habr.com/ru/post/1266948/


All Articles