I have below code which gives proper result while debugging code in visual studio however when this code containing image is deployed on docker then it does not convert it to Spanish
var ci = new CultureInfo(βesβ); var dateStr = DateTime.Now; var result = dateStr.ToString(βMβ, ci);
After deploying docker image getting month in the result in english language and not in Spanish language.
How to get Month name in Spanish after deploying docker image?
2
Answers
To ensure that your Docker container uses Spanish as the default culture, you can try:
In your Dockerfile or in the command used to run your container, you can set the
LANG
environment variable to SpanishDepending on the base image you’re using for your Docker container, you may need to install the Spanish language pack. For example debian:
Depending on the base image you are using, you may need to install the ICU if it not present. You can find additional details here: https://github.com/dotnet/dotnet-docker/blob/main/samples/enable-globalization.md