fix: name a content type's plain label in url_owned without translating it

A label that is not a phrase key (no ::) is used as written, so the
translator no longer logs it as a missing key.
This commit is contained in:
Jakub Zych
2026-11-04 13:44:36 +01:00
parent 2dfc606cdc
commit 397c126833

View File

@@ -639,11 +639,14 @@ func (s *Service) ownerOutsideRegistry(ctx context.Context, path string) (*model
title = l.Title
}
}
label := typ.Label
if strings.TrimSpace(label) == "" {
label := strings.TrimSpace(typ.Label)
switch {
case label == "":
label = typ.Key
case strings.Contains(label, "::"):
label = s.Phrase(label, nil)
}
return &models.Problem{Key: errPageURLOwned, Params: map[string]string{"type": s.Phrase(label, nil), "title": title}}, nil
return &models.Problem{Key: errPageURLOwned, Params: map[string]string{"type": label, "title": title}}, nil
}
return nil, nil
}