Skip to content

Commit

Permalink
Fix config handling.
Browse files Browse the repository at this point in the history
  • Loading branch information
realtimeprojects committed Jun 19, 2024
1 parent 2b2ab60 commit f01d02e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/mkdocs_ezglossary_plugin/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,14 +217,16 @@ def _get_defs(self, section, term):
if len(defs) > 0:
return defs
log.warning(f'plurals: {self.config.plurals}')
if 'plurals' not in self.config:
return
if self.config.plurals == 'inflect':
singular = engine.singular_noun(term)
if not singular:
log.debug(f'no singular for: `{term}`')
return defs
log.warning(f'singular is: `{singular}`')
return self._glossary.get(section, singular, 'defs')
if self.config.plurals and self.config.plurals not in plurals:
if self.config.plurals not in plurals:
log.error('no plurals definition for `{self.config.plurals`')
return defs
_plurals = plurals[self.config.plurals]
Expand Down

0 comments on commit f01d02e

Please sign in to comment.