• R/O
  • HTTP
  • SSH
  • HTTPS

nvdajpmiscdep: Commit

miscdep for NVDA Japanese


Commit MetaInfo

Revision05c64734ba2a9e2f0de3bfdc4fc99773bbab1253 (tree)
Time2014-10-27 15:25:30
AuthorTakuya Nishimoto <nishimotz@gmai...>
CommiterTakuya Nishimoto

Log Message

ti34542 fix JTalk issue with non-Japanese language environment

Change Summary

Incremental Difference

--- a/source/synthDrivers/nvdajp_jtalk.py
+++ b/source/synthDrivers/nvdajp_jtalk.py
@@ -16,6 +16,7 @@ import synthDriverHandler
1616 import languageHandler
1717 from jtalk import jtalkDriver
1818 from jtalk.jtalkDriver import VoiceProperty
19+from jtalk._nvdajp_espeak import isJapaneseLang
1920
2021 class SynthDriver(SynthDriver):
2122 """A Japanese synth driver for NVDAjp.
@@ -57,7 +58,15 @@ class SynthDriver(SynthDriver):
5758 p.pitch = self._pitch
5859 p.inflection = self._inflection
5960 p.characterMode = spellState
60- jtalkDriver.speak(unicode(item), currentLang, index=finalIndex, voiceProperty_=p)
61+ msg = unicode(item)
62+ isMsgJp = isJapaneseLang(msg)
63+ lang = currentLang
64+ if isMsgJp:
65+ lang = 'ja'
66+ elif defaultLanguage != 'ja' and not isMsgJp:
67+ lang = defaultLanguage
68+ log.debug("lang:%s idx:%s pit:%d inf:%d chr:%d (%s)" % (lang, str(finalIndex), p.pitch, p.inflection, p.characterMode, msg))
69+ jtalkDriver.speak(msg, lang, index=finalIndex, voiceProperty_=p)
6170 elif isinstance(item,speech.IndexCommand):
6271 finalIndex = item.index
6372 elif isinstance(item,speech.CharacterModeCommand):
Show on old repository browser