def refresh(self): """@reimp""" self.newPostButton.setVisible(bool(self.topicId)) #self.gameButton.setVisible(bool(self.subjectId)) host = config.API_HOST # must be the same as rest.coffee for the same origin policy user = dataman.manager().user() w = self.webView w.setHtml( rc.haml_template('haml/reader/topicview').render({ 'host': host, 'locale': config.language2htmllocale(user.language), 'title': tr_("Topic"), 'topicId': self.topicId, 'userName': user.name if not user.isGuest() else '', 'userPassword': user.password, 'rc': rc, 'tr': tr_, }), host) self._injectBeans()
def lang(self): """ @return user language in html format """ import config, dataman lang = dataman.manager().user().language return config.language2htmllocale(lang) or 'ja'
def _getLanguage(self): # -> str return config.language2htmllocale( config.LANGUAGES[self.languageEdit.currentIndex()])