Adjust API to handle localized names (bug 1071820)

It's a shame we loop over the contents twice (see `min_length` below)