Skip to content
Permalink
Browse files

Experimental multilingual support.

  • Loading branch information
blueset committed Feb 9, 2018
1 parent bd378b4 commit 6511557417aba161eb26e46236a04d2f40f3f96d
@@ -0,0 +1 @@
recursive-include efb_wechat_slave/locale *.mo *.po

Large diffs are not rendered by default.

@@ -1 +1,3 @@
# coding: utf-8

__version__ = '2.0.0a7'
@@ -1,3 +1,5 @@
# coding: utf-8

import logging
from typing import Optional, List, TYPE_CHECKING

@@ -14,19 +16,20 @@ class ChatManager:

def __init__(self, channel: 'WeChatChannel'):
self.channel: 'WeChatChannel' = channel
# self.itchat: itchat.Core = channel.itchat
self.bot: wxpy.Bot = channel.bot
self.logger: logging.Logger = logging.getLogger(__name__)

self._ = self.channel._

self.MISSING_GROUP: EFBChat = EFBChat(self.channel)
self.MISSING_GROUP.chat_uid = "__error__"
self.MISSING_GROUP.chat_type = ChatType.Group
self.MISSING_GROUP.chat_name = self.MISSING_GROUP.chat_alias = "会话未找到"
self.MISSING_GROUP.chat_name = self.MISSING_GROUP.chat_alias = self._("Chat Missing")

self.MISSING_USER: EFBChat = EFBChat(self.channel)
self.MISSING_USER.chat_uid = "__error__"
self.MISSING_USER.chat_type = ChatType.User
self.MISSING_USER.chat_name = self.MISSING_USER.chat_alias = "会话未找到"
self.MISSING_USER.chat_name = self.MISSING_USER.chat_alias = self._("Chat Missing")

def get_chat_by_puid(self, puid: str) -> EFBChat:
if puid in wxpy.Chat.SYSTEM_ACCOUNTS:
@@ -1,3 +1,5 @@
# coding: utf-8

INVALID_MESSAGE_ID = "__fail__"


0 comments on commit 6511557

Please sign in to comment.
You can’t perform that action at this time.