How do I add nopResources?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
12 years ago
I added a table I call Businesses and I created all the Models, Views, Controllers, Mappings, Route Registers, SiteMap.xml yada, yada, yada.  Got it working but I also manually added a whole bunch of nodes to the defaultResources.admin.nopRes.xml file.   adn defaultResources.Public.nopRes.xml Such as:

<LocaleResource Name="Businesses">
        <Value>Businesses</Value>
        <Children>
....

Instead of my menu choices showing the value, they are showing the name of the resource node starting with Admin.Businesses...

Do I have to register these new resources or am I not copying in a resources .dll from some where?
12 years ago
Well, I didn't get an answer but I did figure out a solution.  Even though the value isn't being read from the resource xml file, it doesn't report an error in, for example, the SiteMap.xml file.  So, I am just typing in the labels and such in the nopResource attribute.  So, before I had "Admin.MyBusinesses" in the nopResource attribute.  Now, I simply have "My Businesses".  Not elegant but it works.
12 years ago
The locale resources are installed into the database from the "...nopres.xml" files.  They're not pulled from the files at runtime.

Look at Nop.Services/Installation/InstallationService.cs and do a search for InstallLanguagesAndResources (line 435 in my code) and AddLocaleResources (line 257 in my code).

I'm sure using the logic in place you could refactor a method to update the resources.  

I'd look into creating an update file and creating a startup task that looks at the update file and inserts/updates any resources in the file, then clears it.  Kinda like a static change queue.

Just an idea.

-D
12 years ago
When you mentioned database, I did a quick scan of the tables. Are the resources being stored in the LocaleStringResource table?
12 years ago
louisd wrote:
When you mentioned database, I did a quick scan of the tables. Are the resources being stored in the LocaleStringResource table?


Yes.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.