I can't find an answer anywhere really so thought I would post a question about it.
I have followed this tutorial ASP.NET MVC 5 Internationalization · How to Store Strings in a Database or Xml
Now that is fine and all, I can get it to work.
The question now is, how to properly incorporate that into the Onion Architecture.
The tutorial has a Resource
Project. Is that still valid or can that be abstracted out?
There is just not a good tutorial on how to incorporate internationalization into the Onion Architecture.
What I have so far is:
- Database Table (Resource) which holds {Name, Culture, Type, Value}
- Entity called
Resource
- Interface called 'IResourceRepository` (GetResources(), GetResource(Culture,Name))
- I have a Service Interface and a Service which also has the same methods as the Repository to get me the resource.
It's my first Time setting up a brand new web application, and only recently learned about the Onion Architecture. Any Help will be very much appreciated.
Update
Here is my partial attempt.
Correct me If i'm wrong please.
- App.Domain.Entities
- Resource.cs (name, culture, type, value)
- App.Domain.Interfaces
- IResourceRepository.cs (GetResources(), GetResource(Culture, Name))
- App.Infrastructure.Data
- ResourceRepository.cs (GetResources(), GetResource(Culture, Name))
- App.Services.Interfaces
- IResourceService.cs (object GetResource(Culture, Name))
- App.Web.UI.Services
- BaseResourceService.cs (Implements IResourceService.cs)
- ResourceService.cs (Extends BaseResourceService.cs)
This is how for I got so far. So Resource
contains a whole bunch of resources for different cultures.
Pretty sure 'n have done something wrong tho.