From a9b7cc5af353c676a02c129a58ebdfa2d38db616 Mon Sep 17 00:00:00 2001 From: SuperSonic Date: Wed, 28 Aug 2019 00:42:35 +0800 Subject: [PATCH 1/3] Update --- libs/i18n/en.py | 6 +++--- libs/yuuki.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/libs/i18n/en.py b/libs/i18n/en.py index a6e40b6..8be5fdc 100644 --- a/libs/i18n/en.py +++ b/libs/i18n/en.py @@ -19,12 +19,12 @@ class English: "Helllo^^\nMy name is %s ><\nNice to meet you OwO": "Helllo^^\nMy name is %s ><\nNice to meet you OwO", "Type:\n\t%s/Help\nto get more information\n\nAdmin of the Group:\n%s": "Type:\n\t%s/Help\nto get more information\n\nAdmin of the Group:\n%s", "%s\n\t%s\n\nCommands Info:\n%s\n\nPrivacy:\n%s\n\nMore Information:\n%s\n\n%s": "%s\n\t%s\n\nCommands Info:\n%s\n\nPrivacy:\n%s\n\nMore Information:\n%s\n\n%s", - "URL:%s\nInvite:%s\nJoin:%s\nMembers:%s\n\nAdmin of the Group:\n%s": "URL:%s\nInvite:%s\nJoin:%s\nMembers:%s\n\nAdmin of the Group:\n%s", + "URL:%s\nInvite:%s\nJoin:%s\nMembers:%s\n\nAdmin of the Group:\n%s": "URL:%s\nInvite:%s\nJoin:%s\nMembers:%s\n\nAdmin of the Group:\n%s", "Wrong UserID or the guy is not in Group": "Wrong UserID or the guy is not in Group", - "Default without Initialize\nAdmin of the Group:\n%s": "Default without Initialize\nAdmin of the Group:\n%s", + "Default without Initialize\nAdmin of the Group:\n%s": "Default without Initialize\nAdmin of the Group:\n%s", "Sorry...\nThe number of members is not satisfied (%s needed)": "Sorry...\nThe number of members is not satisfied (%s needed)", "Name:%s\nPicture URL:%s/%s\nStatusMessage:\n%s\nLINE System UserID:%s": "Name:%s\nPicture URL:%s/%s\nStatusMessage:\n%s\nLINE System UserID:%s", - "LINE System UserID:\n": "LINE System UserID:\n", + "LINE System UserID:\n": "LINE System UserID:\n", "DO NOT KICK, thank you ^^": "DO NOT KICK, thank you ^^", "DO NOT TOUCH THE GROUP URL SETTINGs, see you...": "DO NOT TOUCH THE GROUP URL SETTINGs, see you...", "Do not invite anyone...thanks": "Do not invite anyone...thanks", diff --git a/libs/yuuki.py b/libs/yuuki.py index 9217428..be85cf5 100644 --- a/libs/yuuki.py +++ b/libs/yuuki.py @@ -350,7 +350,7 @@ class Yuuki: elif self.YuukiConfigs["name"] + '/Version' == ncMessage.message.text: self.sendText(self.sendToWho(ncMessage), self.YuukiConfigs["version"]) elif self.YuukiConfigs["name"] + '/UserID' == ncMessage.message.text: - self.sendText(self.sendToWho(ncMessage), _("LINE System UserID:\n") + ncMessage.message.from_) + self.sendText(self.sendToWho(ncMessage), _("LINE System UserID:\n") + ncMessage.message.from_) elif self.YuukiConfigs["name"] + '/Speed' == ncMessage.message.text: Time1 = time.time() self.sendText(self.sendToWho(ncMessage), _("Testing...")) @@ -421,11 +421,11 @@ class Yuuki: GroupInfo = self.client.getGroup(ncMessage.message.to) group_status = self.data.getSEGroup(ncMessage.message.to) if group_status == None: - status = _("Default without Initialize\nAdmin of the Group:\n%s") % ( + status = _("Default without Initialize\nAdmin of the Group:\n%s") % ( self.sybGetGroupCreator(GroupInfo).displayName, ) else: - status = _("URL:%s\nInvite:%s\nJoin:%s\nMembers:%s\n\nAdmin of the Group:\n%s") % ( + status = _("URL:%s\nInvite:%s\nJoin:%s\nMembers:%s\n\nAdmin of the Group:\n%s") % ( group_status[OpType.NOTIFIED_UPDATE_GROUP], group_status[OpType.NOTIFIED_INVITE_INTO_GROUP], group_status[OpType.NOTIFIED_ACCEPT_GROUP_INVITATION], From 96e24f72a8b0c16ca9d7773a9165442a1837d54b Mon Sep 17 00:00:00 2001 From: SuperSonic Date: Wed, 28 Aug 2019 00:45:04 +0800 Subject: [PATCH 2/3] Add i18n Support - Traditional_Chinese --- libs/i18n/__init__.py | 4 +++- libs/i18n/zh_TW.py | 43 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 libs/i18n/zh_TW.py diff --git a/libs/i18n/__init__.py b/libs/i18n/__init__.py index 0a63b4e..e3a7221 100644 --- a/libs/i18n/__init__.py +++ b/libs/i18n/__init__.py @@ -2,12 +2,14 @@ # coding=UTF-8 from .en import English +from .zh_TW import Traditional_Chinese class Yuuki_LangSetting: def __init__(self, default): self.default = default self.support = { - "en":English + "en":English, + "zh-tw":Traditional_Chinese } def gettext(self, text, lang=None): diff --git a/libs/i18n/zh_TW.py b/libs/i18n/zh_TW.py new file mode 100644 index 0000000..91ec441 --- /dev/null +++ b/libs/i18n/zh_TW.py @@ -0,0 +1,43 @@ +#!/usr/bin/python3 +# coding=UTF-8 +""" + Star Yuuki Bot - Yuuki_i18n + ~~~~~~~~~~~ + This is a Language Package in SYB. + It`s belong to Star Yuuki(pYthon) Bot Project of Star Neptune Bot + + The Language Package Contributor: + supersonictw + + Copyright(c) 2019 Star Inc. All Rights Reserved. + The software licensed under Mozilla Public License Version 2.0 +""" + +class Traditional_Chinese: + + i18nText = { + "Helllo^^\nMy name is %s ><\nNice to meet you OwO": "安安^^\n我是%s呦><\n請多多指教OwO", + "Type:\n\t%s/Help\nto get more information\n\nAdmin of the Group:\n%s": "請輸入:\n\t%s/Help\n以獲得更多資訊\n\n本群組管理員為:\n%s", + "%s\n\t%s\n\nCommands Info:\n%s\n\nPrivacy:\n%s\n\nMore Information:\n%s\n\n%s": "%s\n\t%s\n\n指令資訊:\n%s\n\n隱私權政策:\n%s\n\n更多資訊:\n%s\n\n%s", + "URL:%s\nInvite:%s\nJoin:%s\nMembers:%s\n\nAdmin of the Group:\n%s": "網址:%s\n邀請:%s\n加入:%s\n成員:%s\n\n本群組管理員為:\n%s", + "Wrong UserID or the guy is not in Group": "錯誤的用戶識別碼或這傢伙不在群組", + "Default without Initialize\nAdmin of the Group:\n%s": "使用系統預設值,並未初始化\n本群組管理員為:\n%s", + "Sorry...\nThe number of members is not satisfied (%s needed)": "抱歉...\n這個群尚未達到可安裝人數 (需要%s人)", + "Name:%s\nPicture URL:%s/%s\nStatusMessage:\n%s\nLINE System UserID:%s": "名字:%s\n頭像網址:%s/%s\n個性簽名:\n%s\nLINE用戶識別碼:%s", + "LINE System UserID:\n": "LINE用戶識別碼:\n", + "DO NOT KICK, thank you ^^": "請不要踢人,謝謝 =3=", + "DO NOT TOUCH THE GROUP URL SETTINGs, see you...": "請不要動到網址設定,再見了 0.0", + "Do not invite anyone...thanks": "請不要邀請任何人,感謝配合 OwO", + "The User(s) was in our blacklist database.": "這個臭小子在我們的黑名單中 =.=", + "You are our blacklist. Bye~": "再見了~黑名單用戶。", + "You had been blocked by our database.": "您目前已被本程序封鎖。", + "Kick Limit.": "踢人次數已達上限", + "Cancel Limit.": "取消次數已達上限", + "Testing...": "測試中...", + "Speed:\n%ss": "速度為:\n%ss", + "Bye Bye": "掰掰 ><", + "Not Found": "404 不存在 0.0...", + "Okay": " 好的", + "Exit.": "已退出", + "Added": "已增加" + } From a392b86ec62ca66fef4be11843539baf2c74c337 Mon Sep 17 00:00:00 2001 From: SuperSonic Date: Wed, 28 Aug 2019 00:47:21 +0800 Subject: [PATCH 3/3] v6.5.0-alpha_RC3 --- libs/yuuki.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/yuuki.py b/libs/yuuki.py index be85cf5..d3c1c8b 100644 --- a/libs/yuuki.py +++ b/libs/yuuki.py @@ -19,7 +19,7 @@ class Yuuki_Settings: config = { "name": "Yuuki", - "version": "v6.5.0-alpha_RC2", + "version": "v6.5.0-alpha_RC3", "project_url": "https://tinyurl.com/syb-yuuki", "man_page": "None", "privacy_page": "OpenSource - Licensed under MPL 2.0",