code cleanup: remove unnecessary voice option translator

Option "language <name>"already causes SelectTranslator(<name>) to be
called. Having two options to do almost the same thing is unnecessary
and confusing.

In the long term, all options from SelectTranslator() should have a
switch case in LoadVoice() so they are user configurable (see #218). If
needed, a new option (maybe called "LoadOptions") could be added to load
an existing voice or language file.

Changes language configuration files for: hak, cmn, yue, ltg, ms, mb-ma1.
No changes to users.
This commit is contained in:
Juho Hiltunen
2021-03-07 12:58:23 +02:00
parent 6a43f8c984
commit 23a4d88f6b
8 changed files with 1 additions and 20 deletions
+1
View File
@@ -1169,6 +1169,7 @@ Translator *SelectTranslator(const char *name)
}
break;
case L('l', 'v'): // latvian
case L3('l', 't', 'g'): // latgalian
{
static const unsigned char stress_amps_lv[8] = { 14, 10, 10, 8, 0, 0, 20, 15 };
static const short stress_lengths_lv[8] = { 180, 180, 180, 160, 0, 0, 230, 180 };
-13
View File
@@ -72,7 +72,6 @@ enum {
V_NAME = 1,
V_LANGUAGE,
V_GENDER,
V_TRANSLATOR,
V_PHONEMES,
V_DICTIONARY,
V_VARIANTS,
@@ -127,7 +126,6 @@ static MNEM_TAB keyword_tab[] = {
{ "formant", V_FORMANT },
{ "pitch", V_PITCH },
{ "phonemes", V_PHONEMES },
{ "translator", V_TRANSLATOR },
{ "dictionary", V_DICTIONARY },
{ "stressLength", V_STRESSLENGTH },
{ "stressAmp", V_STRESSAMP },
@@ -649,17 +647,6 @@ voice_t *LoadVoice(const char *vname, int control)
current_voice_selected.age = age;
}
break;
case V_TRANSLATOR:
if (tone_only) break;
sscanf(p, "%s", translator_name);
if (new_translator != NULL)
DeleteTranslator(new_translator);
new_translator = SelectTranslator(translator_name);
langopts = &new_translator->langopts;
break;
case V_DICTIONARY: // dictionary
sscanf(p, "%s", new_dictionary);
break;