def produce(): #logging.info('start') first_update() obj = tvslist_updating.mysql_loging() obj.tvsou_update_log catalog.update() update_catalog()
def google_translate(self,code,from_lang,to_lang,args): path = os.path.join(self.locales_directory(),code,'LC_MESSAGES','messages.po') for arg in args: if not 'text_' in arg: continue msg_id = args[arg] msg_id = msg_id.decode('utf-8') translated = turbogears.i18n.utils.google_translate(from_lang,to_lang,msg_id) translated = translated.encode('utf-8') catalog.update(path,msg_id,translated)
def google_translate(self, code, from_lang, to_lang, args): path = os.path.join(self.locales_directory(), code, 'LC_MESSAGES', 'messages.po') for arg in args: if not 'text_' in arg: continue msg_id = args[arg].strip() if '\r' in msg_id: msg_id = '\n'.join(msg_id.splitlines()) translated = i18n.utils.google_translate( from_lang, to_lang, msg_id) catalog.update(path, msg_id, translated)
def UpdateCatalog(self, request, context): logging.info("=========================[%s]", request.description) logging.info("=========================[%s]", request.name) return catalog.update(self.client, context, request.old_name, request.name, request.description)
def update_catalog(self,code,msg_id,msg_text): path = os.path.join(self.locales_directory(),code,'LC_MESSAGES','messages.po') catalog.update(path,msg_id,msg_text) return 'ok'
def update_catalog(self, code, msg_id, msg_text): path = os.path.join(self.locales_directory(), code, 'LC_MESSAGES', 'messages.po') catalog.update(path, msg_id, msg_text) return 'ok'