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:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user