[erlang-questions] Read out the operating system language

Jacob <>
Mon Mar 21 15:06:12 CET 2016


On 21.03.2016 14:23, Michael S wrote:
> Not the type ;)
> I mean the language english, german, spanish, french etc.

This is quite platform dependent. At least with Linux (more precisely on
systems supporting GNU gettext) you can use something like

  os:getenv("LANGUAGE", os:getenv("LC_ALL", os:getenv("LANG", "C"))).

which should do it in most cases (the format of the value may depend on
which environment variable is used). "C" means 'disable localization',
use the application's default language in that case.

This is gettext specific (see info gettext, 'Locale Environment
Variables' and 'Locale Names' for details).

There might also be something helpful in the wxLocale module, but I
didn't check that.



> Am 21.03.16 um 13:32 schrieb Jesper Louis Andersen:
>> On Mon, Mar 21, 2016 at 12:36 PM, Michael S <
>> <mailto:>> wrote:
>>     is there any possibility to read out the language of the operating
>>     system (linux, windows, mac etc.).
>> os:type() or erlang:system_info(os_type).

More information about the erlang-questions mailing list