ATOUTFOX
COMMUNAUTÉ FRANCOPHONE DES PROFESSIONNELS FOXPRO
Visual FoxPro : le développement durable

Forum AtoutFox : Re: SET("century",3)   

Sujet

rss Flux RSS des derniers messages

Vous devez vous identifier pour pouvoir poser une question ou répondre.

mer. 17 septembre 2014, 17h51

FoxInCloud (Th. Nivelet)
France France

atoutfox.public.association

Re: SET("century",3)

J'ai ça dans FoxInCloud, fonctionne nickel (mais avec l'API)
* -----------------------------------
FUNCTION cLangUser && Code langue de l'utilisateur courant
LPARAMETERS tuLocale && [.F.] @ Code langue avec locale (genre 'fr-fr') ou langue forcée

LOCAL lcType, llForce, loShell AS wScript.Shell, lcLang, lcResult

lcType = Vartype(m.tuLocale)

llForce = m.lcType == 'C' AND NOT Empty(m.tuLocale)

IF .T.;
 and not m.llForce;
 and Type('_Screen.cLangUser') == 'C';
 and NOT Empty(_Screen.cLangUser)

  tuLocale = _Screen.cLangUser
  RETURN _Screen.cLangUser

ELSE

  IF m.llForce

    lcResult = Alltrim(m.tuLocale)

  ELSE

    DECLARE INTEGER GetUserDefaultUILanguage IN Win32API
    loShell = CreateObject('wScript.Shell')

    lcResult = Alltrim(GetWordNum('';
      + loShell.RegRead("HKLM\Software\Classes\MIME\Database\RFC1766\";
      + Right(Transform(GetUserDefaultUILanguage(), '@0'), 4));
      , 1, ';'))

    lcResult = Iif(m.lcType == 'L' AND m.tuLocale;
      , m.lcResult + Iif('-' $ m.lcResult, '', '-' + m.lcResult);
      , Left(m.lcResult, 2);
      )

  ENDIF

  store Lower(m.lcResult) to lcResult, tuLocale
  AddProperty(_Screen, 'cLangUser', m.lcResult)

  RETURN m.lcResult
ENDIF


Permalink : http://www.atoutfox.org/nntp.asp?ID=0000015271
20 286 messages dans le forum • Liste complète des messages

www.atoutfox.org - Site de la Communauté Francophone des Professionnels FoxPro - v3.4.0 - © 2004-2026.
Cette page est générée par un composant COM+ développé en Visual FoxPro 9.0-SP2-HF3