Hi Uwe,
On 25/02/2011 12:56, Uwe Grauer wrote:
> 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.
>
I can see that this would work, as does Ed's approach too, but they are
a per application approaches and not a setting which sets all Dabo
applications to the same language - including all the Dabo IDE and demo's.
I am more looking for something which e.g. uses the
dabo.settings.defaultLanguage value. Currently this would need a change
in dLocalize.py which currently gives preference to the Python default
locale over the Dabo default.
Werner
_______________________________________________
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]