Articles from internet, they all do localization base on resource file xxxx.resx
Is there a way we can read resource from database?
Localization is the process of translating an application's resources into localized versions for each culture that the application will support.
resx file contains a standard set of header information that describes the format of the resource entries, and specifies the versioning information for the XML code that parses the data. These files contain all the strings, labels, captions, and titles for all text in the three IBM Cognos Office components.
Resources in . resx files. Unlike text files, which can only store string resources, XML resource (. resx) files can store strings, binary data such as images, icons, and audio clips, and programmatic objects.
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'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With