[orca] Call language logic in soffice's _generateCurrentLineText()
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca] Call language logic in soffice's _generateCurrentLineText()
- Date: Fri, 7 Jan 2022 12:05:58 +0000 (UTC)
commit ab380bff70e444423e180c48efbe5628699ed3ce
Author: Joanmarie Diggs <jdiggs igalia com>
Date: Fri Jan 7 13:03:45 2022 +0100
Call language logic in soffice's _generateCurrentLineText()
This change should not impact the end-user experience. It is a precursor
to implementing support for on-the-fly language switching.
src/orca/scripts/apps/soffice/speech_generator.py | 20 ++++++++++++++------
1 file changed, 14 insertions(+), 6 deletions(-)
---
diff --git a/src/orca/scripts/apps/soffice/speech_generator.py
b/src/orca/scripts/apps/soffice/speech_generator.py
index 65b0a420d..73919a6e3 100644
--- a/src/orca/scripts/apps/soffice/speech_generator.py
+++ b/src/orca/scripts/apps/soffice/speech_generator.py
@@ -246,14 +246,22 @@ class SpeechGenerator(speech_generator.SpeechGenerator):
# together in the scripts. In addition, the voice crap needs to go
# here. Then it needs to be removed from the scripts.
[text, caretOffset, startOffset] = self._script.getTextLineAtCaret(obj)
- voice = self.voice(string=text, obj=obj, **args)
- text = self._script.utilities.adjustForLinks(obj, text, startOffset)
- text = self._script.utilities.adjustForRepeats(text)
if not text:
result = [messages.BLANK]
- else:
- result = [text]
- result.extend(voice)
+ result.extend(self.voice(string=text, obj=obj, **args))
+ return result
+
+ result = []
+ endOffset = startOffset + len(text)
+ split = self._script.utilities.splitSubstringByLanguage(obj, startOffset, endOffset)
+ for start, end, string, language, dialect in split:
+ if not string:
+ continue
+ voice = self.voice(string=string, obj=obj, **args)
+ string = self._script.utilities.adjustForLinks(obj, string, start)
+ rv = [self._script.utilities.adjustForRepeats(string)]
+ rv.extend(voice)
+ result.append(rv)
return result
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]