My Ubuntu Linux 14.04 environment has this variables:

LANG="es_ES.UTF-8"
LANGUAGE="es:en"

<console>
consola gretl: teclee 'help' para obtener una lista de instrucciones
? a=$lang
Se ha generado la cadena de caracteres a
? a
es_ES
</console>




El 22/06/15 a las 16:07, Riccardo (Jack) Lucchetti escribió:
On Mon, 22 Jun 2015, Allin Cottrell wrote:

On Mon, 22 Jun 2015, Ignacio Diaz-Emparanza wrote:

This works in Linux, producing the two first letters of the LANG environment variable:

string lang=substr(getenv("LANG"),1,2)

But I don't know how to do it in Windows (I see Windows 7 has not this variable in the environment)

There's now a $lang accessor in CVS and snapshots. I've done a little testing on Windows but not much. The returned string should be of the form "es_ES", "zh_TW", "en_US" and so on (ISO 639-1 language + '_' + ISO 3166-1 two-letter country).

Hmm.

<bash>
LANGUAGE=it_IT gretl &
</bash>

<console>
Terminale di gretl: scrivere 'help' per la lista dei comandi
? a = $lang
Generata la stringa a
? print a
en_GB
</console>

-------------------------------------------------------
  Riccardo (Jack) Lucchetti
  Dipartimento di Scienze Economiche e Sociali (DiSES)

  Università Politecnica delle Marche
  (formerly known as Università di Ancona)

  r.lucchetti@univpm.it
  http://www2.econ.univpm.it/servizi/hpp/lucchetti
-------------------------------------------------------


_______________________________________________
Gretl-devel mailing list
Gretl-devel@lists.wfu.edu
http://lists.wfu.edu/mailman/listinfo/gretl-devel


-- 
Ignacio Díaz-Emparanza
Departamento de Economía Aplicada III (Econometría y Estadística)
Universidad del País Vasco - Euskalherriko Unibertsitatea, UPV/EHU
Tfno: (+34) 94 601 3732
http://www.ehu.eus/ea3