I have defined resources files for different languages - Resources.de-DE.resx - Resources.en-US.resx - Resources.es-ES.resx - Resources.fr-FR.resx - Resources.it-IT.resx - Resources.nl-NL.resx - Resources.resx
I'm trying to get the localized value of the following string : "Notification created by {user.Name}".
I've tried many things to take the string specified in the right resource file but it doesn't work : it always take the "default" string specified in the Res :
var resourceName = $"MyFunctionApp.Properties.Resources.{plant.LanguageCode}.resx";
var resourceSet = new ResourceSet(Assembly.GetExecutingAssembly().GetManifestResourceStream(resourceName));
string createdBy = resourceSet.GetString(_notificationReportedBy);
Or even:
Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo(plant.LanguageCode);
string longDescription = $"{Resources.NotificationReportedBy} {notificationReported.ValidatedBy }\n{notificationReported.LongDescription}";
Maybe Azure Functions don't support properly the resource files ?
Resource files are not currently supported in Azure Functions. This GitHub issue tracks discussion and implementation of such support: https://github.com/Azure/Azure-Functions/issues/581