2 question: internationalization and serialization
Lloyd Dupont
ld-REMOVE at galador.net
Wed Jun 1 05:51:08 PDT 2011
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?
More information about the Digitalmars-d-learn
mailing list