Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix for bug #1373 #1375

Merged

Conversation

seancpeters
Copy link
Contributor

When the only template match group doesn't have the default language, and no user language is input, then the template will still be chosen as long as the group only contains templates in one language.


if (languagesForMatches.Count > 1)
{
// there are multiple languages in the possible templates. No way to decide which one to use.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't strictly true is it? Couldn't precedence disambiguate (if one language of the template were preferred by the author over the others)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Up to now, we've only considered precedence among templates with the same group identity and language. I could add a check here so that if:

  • all candidate templates are the same group identity
  • user didn't specify a language
    Then don't do the language check. These cases would fall through to the remaining existing checks, the last one being: take the highest precedence template if they're all the same group identity.

The check would change the new if at line 116 to be:
if (_hasUserInputLanguage || _TemplateListResolver..AreAllTemplatesSameGroupIdentity(_coreMatchedTemplates))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants