peng3d/i18n.py
def setLang(self,lang):
        """
        Sets the default language for all domains.
        
        For recommendations regarding the format of the language code, see
        :py:class:`TranslationManager`\ .
        
        Note that the ``lang`` parameter of both :py:meth:`translate()` and
        :py:meth:`translate_lazy()` will override this setting.
        
        Also note that the code won't be checked for existence or plausibility.
        This may cause the fallback strings to be displayed instead if the language
        does not exist.
        
        Calling this method will cause the ``setlang`` action and the
        :peng3d:event`peng3d:i18n.set_lang` event to be triggered. Note that both
        action and event will be triggered even if the language did not actually change.
        
        This method also automatically updates the :confval:`i18n.lang` config value.
        """
        self.lang = lang
        self.peng.cfg["i18n.lang"] = lang
        
        if lang not in self.cache:
            self.cache[lang]={}
        
        self.doAction("setlang")
        self.peng.sendEvent("peng3d:i18n.set_lang",{"lang":self.lang,"i18n":self})
def setLang(self,lang):
        """
        Sets the default language for all domains.
        
        For recommendations regarding the format of the language code, see
        :py:class:`TranslationManager`\ .
        
        Note that the ``lang`` parameter of both :py:meth:`translate()` and
        :py:meth:`translate_lazy()` will override this setting.
        
        Also note that the code won't be checked for existence or plausibility.
        This may cause the fallback strings to be displayed instead if the language
        does not exist.
        
        Calling this method will cause the ``setlang`` action and the
        :peng3d:event`peng3d:i18n.set_lang` event to be triggered. Note that both
        action and event will be triggered even if the language did not actually change.
        
        This method also automatically updates the :confval:`i18n.lang` config value.
        """
        self.lang = lang
        self.peng.cfg["i18n.lang"] = lang
        
        if lang not in self.cache:
            self.cache[lang]={}
        
        self.doAction("setlang")
        self.peng.sendEvent("peng3d:i18n.set_lang",{"lang":self.lang,"i18n":self})
def setLang ( self , lang ) : self . lang = lang self . peng . cfg [ "i18n.lang" ] = lang if lang not in self . cache : self . cache [ lang ] = { } self . doAction ( "setlang" ) self . peng . sendEvent ( "peng3d:i18n.set_lang" , { "lang" : self . lang , "i18n" : self } )
Sets the default language for all domains.
        
        For recommendations regarding the format of the language code, see
        :py:class:`TranslationManager`\ .
        
        Note that the ``lang`` parameter of both :py:meth:`translate()` and
        :py:meth:`translate_lazy()` will override this setting.
        
        Also note that the code won't be checked for existence or plausibility.
        This may cause the fallback strings to be displayed instead if the language
        does not exist.
        
        Calling this method will cause the ``setlang`` action and the
        :peng3d:event`peng3d:i18n.set_lang` event to be triggered. Note that both
        action and event will be triggered even if the language did not actually change.
        
        This method also automatically updates the :confval:`i18n.lang` config value.
Sets the default language for all domains . For recommendations regarding the format of the language code see : py : class : TranslationManager \ . Note that the lang parameter of both : py : meth : translate () and : py : meth : translate_lazy () will override this setting . Also note that the code won t be checked for existence or plausibility . This may cause the fallback strings to be displayed instead if the language does not exist . Calling this method will cause the setlang action and the : peng3d : event peng3d : i18n . set_lang event to be triggered . Note that both action and event will be triggered even if the language did not actually change . This method also automatically updates the : confval : i18n . lang config value .