diff --git a/src/characters.c b/src/characters.c index 9329e6f6..d239cff7 100644 --- a/src/characters.c +++ b/src/characters.c @@ -58,6 +58,12 @@ static bool read_vowel_rules(char *const lang) { gregorio_kpse_find_or_else(filenames, VOWEL_FILE, return false); gregorio_vowel_tables_init(); + /* first check to see if the language is Latin */ + bool is_latin = (strcasecmp(language, "latin") == 0 || + strcasecmp(language, "la") == 0 || + strcasecmp(language, "lat") == 0) ; + /* To allow for users to use customize their own Latin rules, we always + * look for the requested language in the vowel files */ /* only need to try twice; if it's not resolved by then, there is an alias * loop */ for (tries = 0; tries < 2; ++tries) { @@ -85,8 +91,23 @@ static bool read_vowel_rules(char *const lang) { break; } } - if ((strcmp(language, "Latin") == 0 || strcmp(language, "latin") == 0 || strcmp(language, "la") == 0 || strcmp(language, "lat") == 0) && status == RFPS_NOT_FOUND) { - gregorio_messagef("read_rules", VERBOSITY_INFO, 0, "Falling back on internal Latin vowel rules"); + if (status == RFPS_NOT_FOUND) { + if (is_latin) { + gregorio_messagef( + "read_rules", + VERBOSITY_INFO, + 0, + "Using default Latin vowel rules" + ); + } else { + gregorio_messagef( + "read_rules", + VERBOSITY_WARNING, + 0, + "Selecting Latin instead of %s", + language + ); + } } if (status == RFPS_ALIASED) { gregorio_messagef("read_rules", VERBOSITY_WARNING, 0, @@ -108,7 +129,9 @@ static bool read_vowel_rules(char *const lang) { void gregorio_set_centering_language(char *const language) { if (!read_vowel_rules(language)) { - if (strcmp(language, "Latin") != 0 && strcmp(language, "latin") != 0 && strcmp(language, "la") != 0 && strcmp(language, "lat") != 0) { + if ((strcasecmp(language, "latin") != 0 || + strcasecmp(language, "la") != 0 || + strcasecmp(language, "lat") != 0) { gregorio_messagef("gregorio_set_centering_language", VERBOSITY_WARNING, 0, _("unable to read vowel files for " "%s; defaulting to Latin vowel rules"), language);