diff --git a/i18n.go b/i18n.go index 4fc8b65..b3a4ea6 100644 --- a/i18n.go +++ b/i18n.go @@ -1,7 +1,5 @@ package ersteller_lib -import "strings" - type Language string const ( @@ -95,9 +93,6 @@ func (a ActivePath) GetPath(language Language) string { } func (a ActivePath) IsActive(c HtmxContext) bool { - pathWithLang := a.GetPath(c.GetLanguage()) - if pathWithLang == c.GetLanguage().GetPath()+"/" { - return pathWithLang == c.GetPath() - } - return strings.HasPrefix(c.GetPath(), pathWithLang) + contextActivePath := c.GetActivePath() + return contextActivePath != nil && contextActivePath.From(c) == a.From(c) }