digitalmars.D.learn - i18n
- xancorreu (8/8) Feb 02 2012 Hi,
- Stewart Gordon (8/12) Feb 02 2012 Is this just about supporting different human languages in your app?
- xancorreu (3/12) Feb 03 2012 This is by displaying different messages depending of system locale of
- Kagamin (4/7) Feb 04 2012 With LANGUAGE statement?
- Kagamin (2/2) Feb 04 2012 Also
- Alex_Dovhal (4/9) Feb 03 2012 I use small D script to internationalize Delphi projects. It's not perfe...
- xancorreu (4/14) Feb 03 2012 Thank you very much for your solution. I deduce so that there is no
- Trass3r (1/3) Feb 03 2012 Pain? Writing such a system can be done in a couple of lines.
- xancorreu (5/8) Feb 03 2012 How? I don't know how to do that. How to read user current locale?
- H. S. Teoh (9/18) Feb 03 2012 [...]
- Mantis (7/16) Feb 03 2012 I doubt this is a good argument: "I don't know it, so it should be done
- DNewbie (6/19) Feb 03 2012 You can build multiple versions of you app:
- DNewbie (31/36) Feb 03 2012 You can see your language id in this page:
Hi, Is there any way for localizate and internationalizate messages? I were shocked if D has something like Fantom [http://fantom.org/doc/docLang/Localization.html]. Gettext is pretty ugly ;-) If not, any plannings? Thanks, Xan.
Feb 02 2012
On 02/02/2012 18:48, xancorreu wrote:Hi, Is there any way for localizate and internationalizate messages? I were shocked if D has something like Fantom [http://fantom.org/doc/docLang/Localization.html]. Gettext is pretty ugly ;-)Is this just about supporting different human languages in your app? You can put the strings output by your app in a separate file or in a section within the code file to which they apply, and use either version blocks (compile-time) or arrays (run-time) to choose between them. Under Windows, you can use a stringtable resource. It's possible to make resources language-specific, but I don't know how. Stewart.
Feb 02 2012
Al 02/02/12 20:40, En/na Stewart Gordon ha escrit:On 02/02/2012 18:48, xancorreu wrote:This is by displaying different messages depending of system locale of the user.Hi, Is there any way for localizate and internationalizate messages? I were shocked if D has something like Fantom [http://fantom.org/doc/docLang/Localization.html]. Gettext is pretty ugly ;-)Is this just about supporting different human languages in your app?Stewart.
Feb 03 2012
On Thursday, 2 February 2012 at 19:40:14 UTC, Stewart Gordon wrote:Under Windows, you can use a stringtable resource. It's possible to make resources language-specific, but I don't know how.With LANGUAGE statement? http://msdn.microsoft.com/en-us/library/windows/desktop/aa381019%28v=vs.85%29.aspx
Feb 04 2012
Also http://msdn.microsoft.com/en-us/library/windows/desktop/aa381050%28v=vs.85%29.aspx
Feb 04 2012
"xancorreu" <xancorreu gmail.com> wrote:Hi, Is there any way for localizate and internationalizate messages? I were shocked if D has something like Fantom [http://fantom.org/doc/docLang/Localization.html]. Gettext is pretty ugly ;-)I use small D script to internationalize Delphi projects. It's not perfect, but it's simple and easy to modify for one's needs. https://gist.github.com/1728860
Feb 03 2012
Al 03/02/12 09:09, En/na Alex_Dovhal ha escrit:"xancorreu"<xancorreu gmail.com> wrote:Thank you very much for your solution. I deduce so that there is no "official" support for that. If it's, it's a pain. Xan.Hi, Is there any way for localizate and internationalizate messages? I were shocked if D has something like Fantom [http://fantom.org/doc/docLang/Localization.html]. Gettext is pretty ugly ;-)I use small D script to internationalize Delphi projects. It's not perfect, but it's simple and easy to modify for one's needs. https://gist.github.com/1728860
Feb 03 2012
I deduce so that there is no "official" support for that. If it's, it's a pain.Pain? Writing such a system can be done in a couple of lines.
Feb 03 2012
Al 03/02/12 18:07, En/na Trass3r ha escrit:How? I don't know how to do that. How to read user current locale? An official version could simplify the things: people should not wrtite their own code.... Xan.I deduce so that there is no "official" support for that. If it's, it's a pain.Pain? Writing such a system can be done in a couple of lines.
Feb 03 2012
On Fri, Feb 03, 2012 at 09:03:54PM +0100, xancorreu wrote:Al 03/02/12 18:07, En/na Trass3r ha escrit:[...] Write your own version and submit it for review/improvement. Then it'll become official. :) T -- For every argument for something, there is always an equal and opposite argument against it. Debates don't give answers, only wounded or inflated egos.How? I don't know how to do that. How to read user current locale? An official version could simplify the things: people should not wrtite their own code....I deduce so that there is no "official" support for that. If it's, it's a pain.Pain? Writing such a system can be done in a couple of lines.
Feb 03 2012
03.02.2012 22:03, xancorreu пишет:Al 03/02/12 18:07, En/na Trass3r ha escrit:I doubt this is a good argument: "I don't know it, so it should be done for me". Anyway, for windows you probably need to use this function, or related ones: http://msdn.microsoft.com/en-us/library/windows/desktop/dd318136(v=vs.85).aspx I don't know how the thing is done on Unix family systems though, but as usual - Google is your best friend.How? I don't know how to do that. How to read user current locale? An official version could simplify the things: people should not wrtite their own code.... Xan.I deduce so that there is no "official" support for that. If it's, it's a pain.Pain? Writing such a system can be done in a couple of lines.
Feb 03 2012
You can build multiple versions of you app: http://dsource.org/projects/tutorials/wiki/LocalesExample On Thu, Feb 2, 2012, at 07:48 PM, xancorreu wrote:Hi, Is there any way for localizate and internationalizate messages? I were shocked if D has something like Fantom [http://fantom.org/doc/docLang/Localization.html]. Gettext is pretty ugly ;-) If not, any plannings? Thanks, Xan.-- D
Feb 03 2012
On Fri, Feb 3, 2012, at 09:48 PM, Trass3r wrote:You can see your language id in this page: http://msdn.microsoft.com/en-us/library/dd318693(v=vs.85).aspx Example --------------------------------------------------------- import std.stdio; import std.c.windows.windows; alias DWORD LCID; extern (Windows) LCID GetSystemDefaultLCID(); int main() { LCID lcid = GetSystemDefaultLCID(); printf("GetSystemDefaultLCID = 0x%04X\n", lcid); switch (lcid) { case 0x0409: writeln("United States (US)"); break; case 0x040c: writeln("France (FR)"); break; default: writeln("Unknown"); break; } return 0; } ---------------------------------------------------------Thanks a lot, So I just need to "detect" user locale using.... How to do that?You can always use the functions you would use in C.
Feb 03 2012