Changeset 8441

Show
Ignore:
Timestamp:
07/27/07 22:00:44 (18 months ago)
Author:
asterix
Message:

set xml:lang attribute on opening XML stream. fixes #2772

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/common/xmpp/dispatcher_nb.py

    r8014 r8441  
    2424''' 
    2525 
    26 import simplexml, sys 
     26import simplexml, sys, locale 
    2727from xml.parsers.expat import ExpatError 
    2828from protocol import * 
     
    112112                self._metastream.setAttr('xmlns:stream', NS_STREAMS) 
    113113                self._metastream.setAttr('to', self._owner.Server) 
     114                if locale.getdefaultlocale()[0]: 
     115                        self._metastream.setAttr('xml:lang', 
     116                                locale.getdefaultlocale()[0].split('_')[0]) 
    114117                self._owner.send("<?xml version='1.0'?>%s>" % str(self._metastream)[:-2]) 
    115118