- metaDesc.add(new SimpleEntry<String, String>("Author", meta.getAuthor()));
- metaDesc.add(new SimpleEntry<String, String>("Publication date",
- formatDate(meta.getDate())));
- metaDesc.add(new SimpleEntry<String, String>("Published on", meta
- .getPublisher()));
- metaDesc.add(new SimpleEntry<String, String>("URL", meta.getUrl()));
- metaDesc.add(new SimpleEntry<String, String>("Word count", format(meta
- .getWords())));
- metaDesc.add(new SimpleEntry<String, String>("Source", meta.getSource()));
- metaDesc.add(new SimpleEntry<String, String>("Subject", meta
- .getSubject()));
- metaDesc.add(new SimpleEntry<String, String>("Language", meta.getLang()));
- metaDesc.add(new SimpleEntry<String, String>("Tags", tags.toString()));
+ // TODO: i18n
+ metaDesc.put("Author", meta.getAuthor());
+ metaDesc.put("Publication date", formatDate(meta.getDate()));
+ metaDesc.put("Published on", meta.getPublisher());
+ metaDesc.put("URL", meta.getUrl());
+ String count = "";
+ if (meta.getWords() > 0) {
+ count = StringUtils.formatNumber(meta.getWords());
+ }
+ if (meta.isImageDocument()) {
+ metaDesc.put("Number of images", count);
+ } else {
+ metaDesc.put("Number of words", count);
+ }
+ metaDesc.put("Source", meta.getSource());
+ metaDesc.put("Subject", meta.getSubject());
+ metaDesc.put("Language", meta.getLang());
+ metaDesc.put("Tags", tags.toString());