2 question: internationalization and serialization
Jacob Carlborg
doob at me.com
Wed Jun 1 08:41:59 PDT 2011
On 2011-06-01 14:51, Lloyd Dupont wrote:
> Hi I'm a newbie with big ambitions! (Sorry, got spoiled by C#)
>
> Anyhow I'm toying with a D learning project and there are 2 .NET feature
> that will be welcome in this D project:
>
> 1. internationalization.
> the app will contains a bunch of simple UIs and I was wondering how I
> would go on internationalizing the application. I.e. embed multiple
> "resource" for different languages in the EXE and show the appropriate
> ones for the target / running computer
>
>
> 2. I'd like a part of my library (in progress) to read / write some
> arbitrary settings. I was thing to use something akin to the
> DataContractSerialization we have in .NET
> where I could define a few classes with attribute
>
> [DataContract]
> class Root
> {
> [DataMember]
> public int Prop1 { get; set; }
> [DataMember]
> public B PropB { get; set; }
> }
>
> [DataContract]
> class B
> {
> [DataMember]
> public string Name { get; set; }
> }
>
> a reader / writer class can turn this class (using the atributes) into
> text (XML, JSON, I don't care) and back from text into object instance
> How would I implement something similar in D? Is there already a library
> doing it?
For the serialization you could have a look at Orange:
http://www.dsource.org/projects/orange
Don't know if it works with the latest compilers, it's been a while
since I updated the code. I'm also in the middle of complete rewrite of
the library. At lease you can perhaps find some ideas.
--
/Jacob Carlborg
More information about the Digitalmars-d-learn
mailing list