On 02/25/2011 11:46 AM, Werner F. Bruhin wrote:
> I am back for looking how to set a default language for all Dabo apps.
> 
> My os default language is "fr", so reading up on locale.setlocale I 
> thought I could use LANG=en_EN.cp1252 env variable, but that is just 
> ignored.  googling a bit I came across a suggestion that it should be 
> LC_ALL=en_EN.cp1252, but same result.
> 

I use the LANG env variable to switch languages in Linux.
e.g.:
LANG=de_DE.UTF-8
LANG=en_US.UTF-8

After dApp instantiation i do:
    # get LANG from env
    currrent_lang = os.getenv("LANG", None)
    if currrent_lang != None:
        lang, charset = currrent_lang.split('.')
        if lang == 'de_DE':
            print 'Setting dabo.settings.dateFormat to "%d.%m.%Y"'
            dabo.settings.dateFormat = "%d.%m.%Y"
        if charset == 'UTF-8': charset = 'UTF8'
        print 'Calling app.setLanguage("%s", "%s")' % (lang, charset)
        app.setLanguage(lang, charset)

This always worked for my apps.

Uwe
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/[email protected]

Reply via email to