translate page titles of search result page and login page

This commit is contained in:
Stefan Wolff 2016-11-01 16:38:41 +01:00
parent f518e78760
commit 71db92490d
2 changed files with 5 additions and 3 deletions

View file

@ -5,12 +5,14 @@ package edu.cornell.mannlib.vitro.webapp.controller.freemarker;
import java.util.HashMap;
import java.util.Map;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.ResponseValues;
import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.TemplateResponseValues;
import edu.cornell.mannlib.vitro.webapp.i18n.I18n;
/*
* Servlet that only specifies a template, without putting any data
@ -33,7 +35,7 @@ public class StaticPageController extends FreemarkerHttpServlet {
String requestedUrl = vreq.getServletPath();
String title = null;
if (requestedUrl.equals("/login")) {
title = "Log in to " + siteName;
title = StringUtils.capitalize(I18n.text(vreq, "log_in")) + " - " + siteName;
}
return title;
}

View file

@ -262,8 +262,8 @@ public class PagedSearchController extends FreemarkerHttpServlet {
.getIndividualTemplateModels(individuals, vreq));
body.put("querytext", queryText);
body.put("title", queryText + " - " + appBean.getApplicationName()
+ " Search Results");
body.put("title", new StringBuilder().append(appBean.getApplicationName()).append(" - ").
append(I18n.text(vreq, "search_results_for")).append(" '").append(queryText).append("'").toString());
body.put("hitCount", hitCount);
body.put("startIndex", startIndex);