I have created Custom JSON based Localization Provider for IStringLocalizer and and Factory by taking an example of Askmethat-Aspnet-JsonLocalizer,
I have Also Achieved the Data Annotation Localization. and Localized the Validation Messages.
Now, Currently the requirement is that I can Update the Json based language files without restarting the application, Which is also by Injecting the IStringLocalizer as Transient Service.
But What I have observed is That Once the LocalizedStrings Loaded for the DataAnnotation, Its not updating whenever I Update the Json Its not reflecting the DataAnnotation Validation Message But It is if I use IStringLocalizer.
Is it possible that The DataAnnotation StringLocalizer is Singleton?
I have Used Below Code to Achieve DataAnnotationLocalization into startup
services.AddMvcCore()
.AddDataAnnotations()
.AddDataAnnotationsLocalization(options =>
{
options.DataAnnotationLocalizerProvider = (type, factory) =>
factory.Create(string.Empty, string.Empty);
}).SetCompatibilityVersion(CompatibilityVersion.Version_2_1);
Here, Factory Implementation is injected as Transient service.
Is there Anything I missed out or Is it like the DataAnnotation Localization is Singleton Object?