I understand how to use the IStringLocalizer interface in a class which derives from Controller, for example as described here or here.
What would be the correct way to use IStringLocalizer in a class which does not derive from Controller?
I cannot find any examples addressing this question.
Is it always necessary to pass in an IStringLocalizer or IStringLocalizerFactory to the constructor?
Note.
I know that this is a fairly generic question (and Stack Overflow is for concrete programming questions). The background is that I make a localization tool for .NET projects. I am trying to figure out what changes my tool has to make to the source code to support localization in ASP.NET Core projects.