| return NULL; | return NULL; | ||||
| } | } | ||||
| static const char *LookupCharName(Translator *tr, int c, int only) | |||||
| static const char *LookupCharName(Translator *tr, int c, bool only) | |||||
| { | { | ||||
| // Find the phoneme string (in ascii) to speak the name of character c | // Find the phoneme string (in ascii) to speak the name of character c | ||||
| // Used for punctuation characters and symbols | // Used for punctuation characters and symbols | ||||
| } | } | ||||
| } | } | ||||
| if ((only == 0) && ((phonemes[0] == 0) || (phonemes[0] == phonSWITCH)) && (tr->translator_name != L('e', 'n'))) { | |||||
| if ((only == false) && ((phonemes[0] == 0) || (phonemes[0] == phonSWITCH)) && (tr->translator_name != L('e', 'n'))) { | |||||
| // not found, try English | // not found, try English | ||||
| SetTranslator2(ESPEAKNG_DEFAULT_VOICE); | SetTranslator2(ESPEAKNG_DEFAULT_VOICE); | ||||
| string = &single_letter[1]; | string = &single_letter[1]; | ||||
| } else { | } else { | ||||
| DecodeWithPhonemeMode(buf, phonemes, tr, NULL, flags); | DecodeWithPhonemeMode(buf, phonemes, tr, NULL, flags); | ||||
| } | } | ||||
| } else if (only == 0) | |||||
| } else if (only == false) | |||||
| strcpy(buf, "[\002(X1)(X1)(X1)]]"); | strcpy(buf, "[\002(X1)(X1)(X1)]]"); | ||||
| return buf; | return buf; | ||||
| punctname = ph_buf; // use word for 'period' instead of 'dot' | punctname = ph_buf; // use word for 'period' instead of 'dot' | ||||
| } | } | ||||
| if (punctname == NULL) | if (punctname == NULL) | ||||
| punctname = LookupCharName(tr, c1, 0); | |||||
| punctname = LookupCharName(tr, c1, false); | |||||
| if (punctname == NULL) | if (punctname == NULL) | ||||
| return -1; | return -1; | ||||
| char *p2; | char *p2; | ||||
| p2 = &buf[ix]; | p2 = &buf[ix]; | ||||
| sprintf(p2, "%s", LookupCharName(tr, c1, 1)); | |||||
| sprintf(p2, "%s", LookupCharName(tr, c1, true)); | |||||
| if (p2[0] != 0) { | if (p2[0] != 0) { | ||||
| ix += strlen(p2); | ix += strlen(p2); | ||||
| announced_punctuation = c1; | announced_punctuation = c1; |