Hola invitado         02 Sep, 2010 - 04:47
Menú principal
 
Ads
 
Patrocinadores
 
Anuncios
 
© 2009 PortalFox
Lenguaje del Sistema Operativo lecturas 5874
 Enviado por Luis María Guayán en Viernes, 26 Noviembre, 2004
API Con esta API podemos saber el lenguaje por defecto del Sistema Operativo o del Usuario.

Lenguaje del Sistema Operativo

Luis María Guayán Por Luis María Guayán, Tucumán, Argentina



Ejemplo:

? DefaultLanguage("SYSTEM")
? DefaultLanguage("USER")

*----------------------------------------------------
* FUNCTION DefaultLanguage(tc)
*----------------------------------------------------
* Retorna el lenguaje por defecto del SO
* USO: ? DefaultLanguage()
* PARAMETROS:
* "SYSTEM" = Retorna el lenguaje del sistema
* "USER" = Retorna el lenguaje del usuario
* RETORNA: Caracter
*----------------------------------------------------
FUNCTION DefaultLanguage(tc)
LOCAL lnIdLeng, lcLeng
IF EMPTY(tc)
tc = "SYSTEM"
ENDIF
DO CASE
CASE UPPER(tc) = "SYSTEM"
DECLARE SHORT GetSystemDefaultLangID IN kernel32
lnIdLeng = GetSystemDefaultLangID()
CASE UPPER(tc) = "USER"
DECLARE SHORT GetUserDefaultLangID IN kernel32
lnIdLeng = GetUserDefaultLangID()
OTHERWISE
RETURN ""
ENDCASE
DO CASE
CASE lnIdLeng % 256 = 0 && Neutral
lcLeng = "Neutral"
CASE lnIdLeng % 256 = 1 && Arabe
lcLeng = "Arabe"
CASE lnIdLeng % 256 = 3 && Catalán
lcLeng = "Catalán"
CASE lnIdLeng % 256 = 4 && Chino
lcLeng = "Chino"
CASE lnIdLeng % 256 = 7 && Alemán
lcLeng = "Alemán"
CASE lnIdLeng % 256 = 8 && Griego
lcLeng = "Griego"
CASE lnIdLeng % 256 = 9 && Inglés
lcLeng = "Inglés"
CASE lnIdLeng % 256 = 10 && Español
lcLeng = "Español"
CASE lnIdLeng % 256 = 12 && Francés
lcLeng = "Francés"
CASE lnIdLeng % 256 = 16 && Italiano
lcLeng = "Italiano"
CASE lnIdLeng % 256 = 17 && Japonés
lcLeng = "Japonés"
CASE lnIdLeng % 256 = 18 && Coreano
lcLeng = "Coreano"
CASE lnIdLeng % 256 = 22 && Portugues
lcLeng = "Portugués"
CASE lnIdLeng % 256 = 29 && Sueco
lcLeng = "Sueco"
CASE lnIdLeng % 256 = 86 && Gallego
lcLeng = "Gallego"
CASE lnIdLeng % 256 = 107 && Quechua
lcLeng = "Quechua"
OTHERWISE
lcLeng = "Otro lenguaje"
ENDCASE
RETURN lcLeng
ENDFUNC
*----------------------------------------------------


NOTA: Para conocer mas identificadores de lenguajes y poder añadir a la función:

-- Tabla de Identificadores de Lenguaje --
http://msdn.microsoft.com/library/en-us/intl/nls_238z.asp

Otro artículo de la MSKB sobre el tema:

-- How to use the GetUserDefaultLCID Windows API function to determine operating system regional setting language ID from VFP --
http://support.microsoft.com/kb/193080

 Versión imprimible  
Lenguaje del Sistema Operativo | Entrar/Crear una cuenta | 0 Comentarios
Los comentarios son propiedad de sus respectivos autores.
No somos responsables de su contenido.



Todas las marcas y los logos utilizados en este sitio son propiedad de sus respectivos dueños.
Los artículos, noticias y comentarios son propiedad y responsabilidad de sus respectivos autores.
Copyright © 2000-2010 PortalFox. Todos los derechos reservados.