Thread overview | |||||||||
---|---|---|---|---|---|---|---|---|---|
|
October 06, 2003 Locales | ||||
---|---|---|---|---|
| ||||
Hi, all, Scanning the D language specs, I notice that the locale support is missing from the core language. Many forerunners of D had the same issues with the locale support retro-fitted as an after thought and generally quite complex. Since D seems tackle many similar issues at the language level, I would like to know the rationale behind leaving this important feature out. Cheers, Sarat |
October 06, 2003 Re: Locales | ||||
---|---|---|---|---|
| ||||
Posted in reply to Sarat Venugopal Attachments: | Sarat Venugopal wrote: > Hi, all, > Scanning the D language specs, I notice that the locale support is > missing from the core language. Many forerunners of D had the same issues > with the locale support retro-fitted as an after thought and generally quite > complex. Since D seems tackle many similar issues at the language level, I > would like to know the rationale behind leaving this important feature out. > > Cheers, > Sarat http://www.digitalmars.com/d/version.html Does version() fall short of your needs? I've never done any localization, so I don't know exactly what the limitations of version() would be. Walter tends to be open to suggestions if you make a proposal. I attached an example of how version might be used for localization. It's simplistic, but it compiles. Justin |
October 07, 2003 Re: Locales | ||||
---|---|---|---|---|
| ||||
Posted in reply to J C Calvarese | Support for locales involves more that just strings - things like formatting dates, numbers, monetary quantities and so on. Internationalization and easy localization abilities must be built into any modern language. I do realize that it is not something most people enjoy doing. Cheers, Sarat "J C Calvarese" <jcc7@cox.net> wrote in message news:blsrud$9ql$1@digitaldaemon.com... > Sarat Venugopal wrote: > > Hi, all, > > Scanning the D language specs, I notice that the locale support is > > missing from the core language. Many forerunners of D had the same issues > > with the locale support retro-fitted as an after thought and generally quite > > complex. Since D seems tackle many similar issues at the language level, I > > would like to know the rationale behind leaving this important feature out. > > > > Cheers, > > Sarat > > http://www.digitalmars.com/d/version.html > > Does version() fall short of your needs? I've never done any localization, so I don't know exactly what the limitations of version() would be. Walter tends to be open to suggestions if you make a proposal. I attached an example of how version might be used for localization. It's simplistic, but it compiles. > > Justin > ---------------------------------------------------------------------------- ---- > /* > > locales.d > > Author: Justin C Calvarese > Date: October 6, 2003 > License: Public Domain > > Demonstrates using version() to handle different locales. > > Compile for the English locale: > dmd locales.d -version=English > > Compile for the German locale: > dmd locales.d -version=Deutsch > > */ > > version(English) > { > const char[] salutation = "Hi"; > const char[] negative = "No"; > } > > version(Espanol) > { > const char[] salutation = "Hola"; > const char[] negative = "No"; > } > > version(Francais) > { > const char[] salutation = "Bonjour"; > const char[] negative = "Non"; > } > > version(Deutsch) > { > const char[] salutation = "Hallo"; > const char[] negative = "Nein"; > } > > > int main() > { > printf("%.*s\n", salutation); > return 0; > } |
October 07, 2003 Re: Locales | ||||
---|---|---|---|---|
| ||||
Posted in reply to Sarat Venugopal | Sarat Venugopal wrote: > > Support for locales involves more that just strings - things like formatting dates, numbers, monetary quantities and so on. > > Internationalization and easy localization abilities must be built into any modern language. I do realize that it is not something most people enjoy doing. I agree with you. I would even add that this localization must be independent from the system configuration and changeable at runtime within the applications. I think that those most affected - are you from India? - should put forward a draft or specification that meets their demand. -- Helmut Leitner leitner@hls.via.at Graz, Austria www.hls-software.com |
October 07, 2003 Re: Locales | ||||
---|---|---|---|---|
| ||||
Posted in reply to Helmut Leitner | "Helmut Leitner" <leitner@hls.via.at> wrote in message news:3F82B9CD.AC87585@hls.via.at... > I would even add that this localization must be independent from the system > configuration and changeable at runtime within the applications. I think this aspect is more of an application level issue, though. > I think that those most affected - are you from India? - should put forward a draft or specification that meets their demand. I am an Indian, but based in Singapore. The most affected, however, are in China, Japan, Korea, parts of Europe, and South America. The issue is not whether the programmer is affeted; rather the target market for the application. I am involved in (consumer) applications that are localized in as many as 26 languages! I'll have to dig a bit deeper into D before I get involved. Cheers, Sarat |
October 07, 2003 Re: Locales | ||||
---|---|---|---|---|
| ||||
Posted in reply to Sarat Venugopal | "Sarat Venugopal" <sarat_ng@n0spam.huelix.com> wrote in message news:blqtr8$5dm$1@digitaldaemon.com... > Hi, all, > Scanning the D language specs, I notice that the locale support is > missing from the core language. Many forerunners of D had the same issues > with the locale support retro-fitted as an after thought and generally quite > complex. Since D seems tackle many similar issues at the language level, I would like to know the rationale behind leaving this important feature out. Locales are important, and are unaddressed at this point by the D library. The D core language itself, however, has pretty good support for unicode source and unicode strings. |
October 08, 2003 Re: Locales | ||||
---|---|---|---|---|
| ||||
Posted in reply to Sarat Venugopal Attachments: | Sarat Venugopal wrote: > Support for locales involves more that just strings - things like formatting dates, numbers, monetary quantities and so on. As far as I can tell these issues can be approached either by using version() and then compiling separate executables (as in the attached date example), or by creating a library with all of the localities and compiling support for all of the localities into the same executable. Is this different than what you were expecting? > > Internationalization and easy localization abilities must be built into any modern language. I do realize that it is not something most people enjoy doing. Is there a programming language that you think has done it correctly or come close to your preferred method? For example, do you like Java's Locale class (java.util)? > > Cheers, > Sarat Sincerely, Justin |
Copyright © 1999-2021 by the D Language Foundation