Using IViewLocalizer
I would like to implement view localization with a default or fallback resource file for words and phrases that appear on multiple pages like for example edit, add, delete... I don't want to add these repetitive phrases in the resource file of all the views where they appear so a fallback recource file would really come handy, but I just can't seem to find any solutions on how to do that.
Currently I'm using @inject IViewLocalizer Localizer
on my views and I'm getting the localized phrases with @Localizer["ResourceName"]
from the resource files:
Resources/Views/{ControllerName}/{ViewName}.{langCode}.resx
This works just fine for each separate view and partial view. Now I would like to have a resource file either in the Resources/Views
or Resources
folder that acts as a fallback resource file.
So for example if I say @Localizer["Edit"]
on one of my views and the "Edit" resource is not found in the Resources/Views/{ControllerName}/{ViewName}.{langCode}.resx
or Resources/Views/{ControllerName}/{ViewName}.resx
, it falls back to this default file so that I can use this on all of my views that need the resource "Edit".
I've allready tried with Resources/Resource.{langCode}.resx
but it seems to have no effect.