ven. 30 juillet 2010, 16h10
Thierry N
atoutfox.public.association
Re: 'locale language'
ça marche nickel
Merci à tous
thn
"Gregory Adam" <NoOne@NoWhere.com> a écrit dans le message de
news:i2ui5f$212i$1@news.niouzes.net...
> Thierry,
>
> Essaye ceci - tout se trouve dans la base de registre
>
> #include "Foxpro.h"
>
> #define false .f.
> #define true .t.
>
>
*___________________________________________________________________________
____
> function test()
>
> local s
> local langId
>
> langId = 1033 && 1036
>
> if( GetLangStringFromLangId(@m.s, m.langId) )
> ? m.langId, m.s
>
> else
> ? m.langId, 'Fail'
>
> endif
>
> endfunc
>
*___________________________________________________________________________
____
>
*___________________________________________________________________________
____
> function GetLangStringFromLangId(s, langId)
>
> local success
> success = true
>
> local shellObj, sKey
>
> do case
> case !m.success
>
> otherwise
> try
> sKey = right(transf(m.langId, '@0'), 4)
>
> shellObj = CreateObject("WScript.Shell")
> s = m.shellObj.RegRead("HKLM\SOFTWARE\Classes\MIME\Database\Rfc1766\" +
> m.sKey)
>
> s= left(m.s, at(';', m.s)-1)
>
> if( empty(at('-', m.s)) )
> s = m.s + '-' + m.s
> endif
>
> catch
> assert false
> success = false
>
> endtry
>
> endcase
>
>
>
> return m.success
>
> endfunc
>
*___________________________________________________________________________
____
>
> --
> Gregory
> _
>
> "Thierry N" <none@zenbuyer.com> wrote in message
> news:i2ubdv$1u0r$1@news.niouzes.net...
> > Bonjour à tous
> >
> > Comment, avec l'API windows, trouver le code de langue courant dans un
> > format compatible web (genre 'fr-fr', 'en-us', etc.) ?
> >
> > GetUserDefaultUILanguage() donne le 'language ID', genre 1036, 1033,
etc.
> >
> > J'ai bien trouvé ça mais je n'y comprends que goutte ...
> >
http://nibuthomas.wordpress.com/2007/12/06/how-to-convert-language-ids-like-1033-to-english-united-states-form/> >
> > merci
> > thn
> >
> >
> >
>
Permalink : http://www.atoutfox.org/nntp.asp?ID=0000003743