Localizing a D application - best practices?
Freddy via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Mon Sep 29 15:28:56 PDT 2014
On Sunday, 28 September 2014 at 21:29:21 UTC, Cliff wrote:
> Coming from the C# world, all of localization we did was based
> on defining string resource files (XML-formatted source files
> which were translated into C# classes with named-string
> accessors by the build process) that would get included in the
> final application. For log messages, exception messages
> (because unhandled exceptions could make it to the user in the
> case of a bug) and format strings used for the above we would
> create a string table entry and this file would eventually get
> localized by the appropriate team.
>
> Is there a recommended pattern for applications in D that wish
> to do localization?
>
> Thanks.
I personally recommend you do this
---
void main(){
string name=import("mylang");
}
---
and add a folder with mylang with -J .
eg:
-Jenglish
-Jspanish
More information about the Digitalmars-d-learn
mailing list