Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 26 additions & 3 deletions src/characters.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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,
Expand All @@ -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);
Expand Down