Greetings!
I'm interested in extending what's available in the .NET framework
with regards to globalization and localization. I've read many
articles that discuss extending so that a datasource other than RESX
files (Ex: database) can be used, such as this one:
http://msdn2.microsoft.com/en-us/library/aa905797.asp
Most of these articles use the same idea of key-value pairs - just a
different datasource. I was wondering if anyone could provide some
insight as to whether it's possible to extend what .NET offers such
that content can come from, say, XML files. And not in the key-value
sense, but more along the lines of XPath or XQuery? If this is
possible, where might there be some good resources targeting .NET 3.5
to help get started? Thanks in advance.
Andrew - 19 Dec 2007 05:02 GMT
Hi,
Actually RESX files are XML files anyway. If you wanted to, you could get
that info into your own XML format and read it out using XPath etc, but you'd
have to write a fair bit of redundant code.
The basic premise of RESX's / key-value pairs is that the key is like the
placeholder on your page (eg: hello_label) with the value in each data
source/resx being the implementation of that key (eg: "hello", "ni hao") etc.
It's because of the simplicity of this structure that you don't have to spend
time defining your own XML structure.
For more info on localization, you can have a look at this post on my blog:
http://geekswithblogs.net/dotNETPlayground/archive/2007/11/09/116726.aspx
best regards,
Andrew
Patrice - 19 Dec 2007 12:13 GMT
You could perhaps keep those keys and have your provider to interpret their
meaning as you wish depending what is the value you want to add by using
those custom expressions...
The localization expression themselves (as well as other expressions) are
anyway customizable even though you may want to dive into this only if you
really have to :
http://aspalliance.com/1113_Creating_a_Custom_ExpressionBuilder_in_ASPNET_20
--
Patrice
> Greetings!
>
[quoted text clipped - 12 lines]
> possible, where might there be some good resources targeting .NET 3.5
> to help get started? Thanks in advance.
bruce barker - 19 Dec 2007 16:46 GMT
the most common way of localization with xml is via xslt transformations. see
the Xml control.
-- bruce (sqlwork.com)
> Greetings!
>
[quoted text clipped - 12 lines]
> possible, where might there be some good resources targeting .NET 3.5
> to help get started? Thanks in advance.