Correctly report accented letters after cap (PR #11977)
Fixes #11948
# Summary of the issue:
As described in #11948, some letter with diacritic is not spelt correctly with some synth if "Say cap before capitale" is checked, e. g. 'À' is spelt 'cap A' instead of 'cap A grave'.
Looking at getSpellingSpeech function in speech\__init__.py, it appears that this is due to the fact that the string 'cap À' is passed to the synth in the speech sequence in such a case. But the synth is only asked to use character mode for the strings whose length is 1. This is wrong in this case, because 'cap' should be spoken with character mode off, but 'À' should be spoken with character mode on.
# Description of how this pull request fixes the issue:
In getSpellingSpeech, in the string sequence, I have separated the 'cap' message string from the character to be spelt. If the character to be spelt is of length 1, i.e. not replaced by symbol description or modified pronunciation, character mode is activated. If a string in the speech sequence has a length > 1, because it is a capitalization message or because it corresponds to a character description or symbol replacement, character mode is disabled.
Note that the 'cap' message can be of two types:
- with 'cap' indication before as in English: 'cap %s'
- with 'cap' indication after as in French: '%s majuscule'
Co-authored-by: Reef Turner <reef@nvaccess.org>