So I've built a plugin by copying and modifying another plugin. Things are going smooth but I'm having an issue and I just don't have a grip on exactly how local strings are mapped to plugin fields and it's making it hard to debug.
First I changed the existing plugin to my field name. (This worked)
Model.cs
[NopResourceDisplayName("RG.Plugin.MyPlugin.nopDefaultProductId")]
public int nopDefaultProductId { get; set; }
Plugin.cs
_localizationService.AddOrUpdatePluginLocaleResource("RG.Plugin.MyPlugin.nopDefaultProductId", "Default nop Product Id");
_localizationService.AddOrUpdatePluginLocaleResource("RG.Plugin.MyPlugin.nopDefaultProductId.Hint", "The nopCommerce ProductId to use");
Configure.cshtml
<div class="col-md-3">
<nop-label asp-for="nopDefaultProductId" />
</div>
As I said, this worked fine. But then I went back to add another field - Select list based on an enum (using Payments.Square as my guide)
Model.cs
[NopResourceDisplayName("RG.Plugin.MyPlugin.Country")]
public int CountryId { get; set; }
Plugin.cs
_localizationService.AddOrUpdatePluginLocaleResource("RG.Plugin.MyPlugin.Country", "Country");
_localizationService.AddOrUpdatePluginLocaleResource("RG.Plugin.MyPlugin.Fields.Country.Hint", "Choose your country");
Configure.cshtml
<div class="col-md-3">
<nop-label asp-for="CountryId" />
</div>
This does not work. The select list works fine - but for the label, the configure page shows "RG.Plugin.MyPlugin.Fields.Country" (instead of the prompt and hint).
When I look in Languages configuration - I see that the string has been added to the database with the name NOT INCLUDING the word "Fields" (RG.Plugin.MyPlugin.Country). But clearly the view is looking for the word "Fields" in the name.
In fact, if I manually change the language string name and include "Fields" - the configure page pulls over the correct prompt and hint text.
So my question is - where is "Fields" coming from?
Or, more generally, my question is - is there a document somewhere that describes the correlation between Model/View and database with regard to using localized strings on a plugin configure page? (e.g. how to correctly add them, delete them and use them)
This would help me understand so that whenever this happens I'll know where to start looking to track down the problem.