Skip to content

Commit

Permalink
Updated to 2.97
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxe committed Jun 16, 2024
1 parent b0c8875 commit 36f2335
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 5 deletions.
23 changes: 22 additions & 1 deletion addon/doc/zh_TW/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
# 更新日誌

## V2.97, 2024.6.16

版本代號:吉他與孤獨與藍色星球

Source:
https://youtu.be/B7BxrAAXl94?si=SnZepdZgZX5BAhpz

### 更新項目

1. Youtube 聊天室:新增僅朗讀頻道主與管理員訊息的功能,預設關閉,可在字幕閱讀器選單當中啟用。
2. Youtube 聊天室:意見調查改為在移動焦點之後會再次朗讀,之前只會朗讀一次,錯過就不會再聽到了。
3. 新增日語翻譯,感謝 guredora!
4. 更新芬蘭語翻譯,感謝 jkinnunen

### 修正巷木

1. 修正在最新的 NVDA Alpha 版本當中使用 Pot Player, NVDA 不朗讀任何內容的錯誤,感謝 cary 和 hwf1324
P.S 怎麼那麼多人都這麼超前再用測試版呢?我一職再用正式版本,不太會知道這些問題。

---

## V2.96, 2024.6.10

版本代號:未知未踏
Expand All @@ -16,7 +37,7 @@ https://youtu.be/O0uH8ZJqUy8?si=uvdUtuaIqEDOydON

2. Youtube 聊天室,新增讀出進行中的意見調查。
3. 修正錯誤的尋找聊天室方法,加快找到聊天室的速度。
4. 更新西語翻譯,感謝 Carlos-
4. 更新西語翻譯,感謝 Carlos

---

Expand Down
6 changes: 6 additions & 0 deletions addon/globalPlugins/subtitle_reader/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ def initMenu(self):
gui.tray.Bind(gui.wx.EVT_MENU, self.toggleBackgroundReading, menu.backgroundReading)
gui.tray.Bind(gui.wx.EVT_MENU, self.toggleReadChat, menu.readChat)
gui.tray.Bind(gui.wx.EVT_MENU, self.toggleReadChatSender, menu.readChatSender)
gui.tray.Bind(gui.wx.EVT_MENU, self.toggleOnlyReadManagersChat, menu.onlyReadManagersChat)
gui.tray.Bind(gui.wx.EVT_MENU, self.toggleReadChatGiftSponser, menu.readChatGiftSponser)
gui.tray.Bind(gui.wx.EVT_MENU, self.toggleOmitChatGraphic, menu.omitChatGraphic)
gui.tray.Bind(gui.wx.EVT_MENU, self.toggleInfoCardPrompt, menu.infoCardPrompt)
Expand All @@ -102,6 +103,7 @@ def initMenu(self):
menu.backgroundReading.Check(conf['backgroundReading'])
menu.readChat.Check(conf['readChat'])
menu.readChatSender.Check(conf['readChatSender'])
menu.onlyReadManagersChat.Check(conf['onlyReadManagersChat'])
menu.readChatGiftSponser.Check(conf['readChatGiftSponser'])
menu.omitChatGraphic.Check(conf['omitChatGraphic'])
menu.infoCardPrompt.Check(conf['infoCardPrompt'])
Expand Down Expand Up @@ -353,6 +355,10 @@ def toggleReadChatSender(self, evt):
conf['readChatSender'] = not conf['readChatSender']
self.menu.readChatSender.Check(conf['readChatSender'])

def toggleOnlyReadManagersChat(self, evt):
conf['onlyReadManagersChat'] = not conf['onlyReadManagersChat']
self.menu.onlyReadManagersChat.Check(conf['onlyReadManagersChat'])

def toggleReadChatGiftSponser(self, evt):
conf['readChatGiftSponser'] = not conf['readChatGiftSponser']
self.menu.readChatGiftSponser.Check(conf['readChatGiftSponser'])
Expand Down
1 change: 1 addition & 0 deletions addon/globalPlugins/subtitle_reader/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ def load(self, fileName):
'backgroundReading': True,
'readChat': True,
'readChatSender': False,
'onlyReadManagersChat': False,
'readChatGiftSponser': True,
'omitChatGraphic': True,
'infoCardPrompt': True,
Expand Down
4 changes: 4 additions & 0 deletions addon/globalPlugins/subtitle_reader/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ def __init__(self):
self.readChatSender = self.youtube.AppendCheckItem(wx.ID_ANY, _(u'閱讀聊天室訊息發送者(&A)'))
self.readChatSender.Check(True)

# Translators: toggle Youtube menu item whether to read the manager's chat message only.
self.onlyReadManagersChat = self.youtube.AppendCheckItem(wx.ID_ANY, _(u'僅閱讀管理員訊息(&M)'))
self.onlyReadManagersChat.Check(False)

# Translators: toggle Youtube menu item whether to read the chat gift sponser message.
self.readChatGiftSponser = self.youtube.AppendCheckItem(wx.ID_ANY, _(u'閱讀會籍贈送(&G)'))
self.readChatGiftSponser.Check(True)
Expand Down
8 changes: 6 additions & 2 deletions addon/globalPlugins/subtitle_reader/youtube.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ def getChatContainer(self):
self.chatRoom = None
self.chatContainer = None
self.chatObject = None
self.voting = None
if self.chatContainerSearchObject:
self.chatContainerSearchObject.cancel()

Expand Down Expand Up @@ -286,6 +287,9 @@ def onFoundChatObject(self, chat):

self.chatSearchObject.cancel()

if conf['onlyReadManagersChat'] and not self.chatSenderIsOwner and not self.chatSenderIsAdmin:
return

chat = getattr(chat, 'firstChild', None)
if not chat:
return
Expand All @@ -310,7 +314,7 @@ def onFoundChatObject(self, chat):

self.chat = text

sender = f'{self.chatSender}\r\n{self.chatSenderIsVerified}\r\n{self.chatSenderIsAdmin}\r\n'
sender = f'{self.chatSender}\r\n{self.chatSenderIsVerified}\r\n{self.chatSenderIsAdmin}\r\n'
if conf['readChatSender'] or self.chatSenderIsOwner or self.chatSenderIsVerified or self.chatSenderIsAdmin:
text = sender + text

Expand All @@ -325,7 +329,7 @@ def readVoting(self):
if bool(votingObj) != self.voting:
self.voting = bool(votingObj)
if self.voting:
ui.message('意見調查:')
ui.message(_('意見調查:'))
search(votingObj, lambda obj: True, self.onSearchVoting, continueOnFound=True)


Expand Down
2 changes: 1 addition & 1 deletion addon/manifest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ summary = "字幕閱讀器"
description = """當焦點位於網頁上的影片播放器時,讓 NVDA 讀出字幕。"""
author = "福恩 <[email protected]>"
url = https://github.com/maxe-hsieh/subtitle_reader
version = 2.96
version = 2.97
docFileName = readme.html
minimumNVDAVersion = 2019.2.1
lastTestedNVDAVersion = 2024.1
Expand Down
2 changes: 1 addition & 1 deletion buildVars.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def _(arg):
# Translators: Long description to be shown for this add-on on add-on information from add-ons manager
"addon_description": _("當焦點位於網頁上的影片播放器時,讓 NVDA 讀出字幕。"),
# version
"addon_version": "2.96",
"addon_version": "2.97",
# Author(s)
"addon_author": "福恩 <[email protected]>",
# URL for the add-on documentation support
Expand Down

0 comments on commit 36f2335

Please sign in to comment.