Articles from internet, they all do localization base on resource file xxxx.resx
开发者_开发知识库
Is there a way we can read resource from database?
ASP.NET resource provider model is extensible - so you can create your own resource provider and factories to get the resources from database. See below articles for more information:
Extending the ASP.NET 2.0 Resource-Provider Model
ASP.NET 2.0: Custom Resource Provider Using Sql Database
yes you can store localize data in database rather than in *.resx file
following may be design of the table, this is just demo
CREATE TABLE [LocalizedData]
(
[Identifier] varchar(50) NOT NULL,
[Language] varchar(5) NOT NULL,
[Title] nvarchar(50),
[Description] nvarchar(200),
PRIMARY KEY ([Identifier], [Language])
)
data something like this
INSERT INTO [LocalizedData] ([Identifier], [Language], [Title], [Description])
SELECT 'String1', 'en', 'first entry', 'This is my first entry'
精彩评论