开发者

How to do localization without resource file?

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'
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜