From: Jan Svitok Date: 2007-02-13T03:38:26+09:00 Subject: Re: Windows Language On 2/12/07, Jan Svitok wrote: > On 2/12/07, Jason Mayer wrote: > > On 2/12/07, Andr� wrote: > > > > > > Hello, > > > > > > Is it possible to find the Windows natural language (ex. English, > > > French, Russian, etc...) from Ruby? > > > > > > Thank you in advance, > > > > > > Andr� > > > > If you don't mind using some good old fashioned command line tools, here's a > > solution. > > > > variables = `set` > > lang_used = variables.scan(%r{LANG=.}) > > puts lang_used > > > > Hope that helps. > > > > I have no such variable set (XP SP2). The list of languages is here: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/intl/nls_61df.asp (The table is inwin32utils/windows-pr as well). The function to retrieve is here: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/intl/nls_2ip1.asp or here: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/intl/nls_5c85.asp depending on whether you want the system language or the user one (multiple users can specify different languages) Use WIN32API to glue them together (I don't have time now to write the function, sorry)