private void checkTemplates(Map<String, Template> templates, String fieldName) {
Iterator<Lang> langs = this.getLangManager().getLangs().iterator();
while (langs.hasNext()) {
Lang lang = langs.next();
Template template = templates.get(lang.getCode());
if (template==null) {
this.addFieldError(fieldName, this.getText("jpuserreg.errors.templates.notValued", new String[] { this.getText(fieldName), lang.getDescr() }));
} else {
String subject = template.getSubject();
if (subject==null || subject.trim().length()==0) {
this.addFieldError(fieldName, this.getText("jpuserreg.errors.templates.subject.notValued", new String[] { this.getText(fieldName), lang.getDescr() }));
}
String body = template.getBody();
if (body==null || body.trim().length()==0) {
this.addFieldError(fieldName, this.getText("jpuserreg.errors.templates.body.notValued", new String[] { this.getText(fieldName), lang.getDescr() }));
}
}
}