Initial i18n setup and translations.

pull/763/head
Fredrik Jönsson 2015-02-04 13:50:09 +01:00
parent 166c53cd6a
commit 222b7bae91
7 changed files with 78 additions and 16 deletions

View File

@ -0,0 +1,20 @@
common.Edit=Edit
common.login=Log in
common.logout=Log out
about.title=About
about.body=<p>\
This OpenID Connect service is built from the MITREid Connect Open Source project, from \
<a href="http://www.mitre.org/">The MITRE Corporation</a> and the <a href="http://kit.mit.edu/">MIT Kerberos and Internet Trust Consortium</a>.\
</p>\
<p>\
More information about the project can be found at \
<a href="http://github.com/mitreid-connect/">MITREid Connect on GitHub</a>. \
There, you can submit bug reports, give feedback, or even contribute code patches for additional features you'd like to see.\
</p>
statistics.title=Statistics
home.title=Home
contact.title=Contact

View File

@ -0,0 +1,21 @@
common.Edit=Ändra
common.login=Logga in
common.logout=Logga ut
about.title=Om&nbsp;Tjänsten
about.body=<p>\
Denna OpenID Connect är baserad på öppen källkod ifrån projektet MITREid, skapat av \
<a href="http://www.mitre.org/">The MITRE Corporation</a> och <a href="http://kit.mit.edu/">MIT Kerberos and Internet Trust Consortium</a>.\
</p>\
<p>\
Mer information om projektet kan finns i projektet \
<a href="http://github.com/mitreid-connect/">MITREid Connect på GitHub</a>. \
Där kan du skicka in felrapporter, komma med återkoppling, eller till och med bidra med kodtillägg för ytterligare funktioner du skulle vilja ha.\
</p>
statistics.title=Statistik
home.title=Hem
contact.title=Kontakt

View File

@ -200,7 +200,27 @@
</security:authentication-manager>
<bean id="clientAssertionAuthenticationProvider" class="org.mitre.openid.connect.assertion.JwtBearerAuthenticationProvider" />
<!-- <bean id="localeResolver" class="org.springframework.web.servlet.i18n.AcceptHeaderLocaleResolver"> -->
<bean id="localeResolver" class="org.springframework.web.servlet.i18n.FixedLocaleResolver">
<property name="defaultLocale" value="sv" />
</bean>
<bean id="localeChangeInterceptor" class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor" />
<bean id="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
<property name="basenames">
<list>
<value>classpath:custom_messages</value>
<value>classpath:messages</value>
</list>
</property>
<property name="fallbackToSystemLocale" value="false" />
<property name="cacheSeconds" value="180" />
<property name="defaultEncoding" value="UTF-8" />
<property name="useCodeAsDefaultMessage" value="true" />
</bean>
<!-- user services -->
<import resource="user-context.xml" />

View File

@ -1,5 +1,3 @@
<h2>About</h2>
<p>This OpenID Connect service is built from the MITREid Connect Open Source project, from <a href="http://www.mitre.org/">The MITRE Corporation</a> and the <a href="http://kit.mit.edu/">MIT Kerberos and Internet Trust Consortium</a>.</p>
<p>
More information about the project can be found at <a href="http://github.com/mitreid-connect/">MITREid Connect on GitHub</a>. There, you can submit bug reports, give feedback, or even contribute code patches for additional features you'd like to see.
</p>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<h2><spring:message code="about.title" text="About"/></h2>
<spring:message code="about.body" text="About body"/>

View File

@ -1,6 +1,7 @@
<%@attribute name="title" required="false"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ tag import="com.google.gson.Gson" %>
<!DOCTYPE html>
<html lang="en">

View File

@ -1,4 +1,5 @@
<h2>Current Statistics</h2>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<h2><spring:message code="statistics.title" text="Statistics"/></h2>
<p>There have been
<span class="label label-info">${statsSummary["userCount"]}</span> user${statsSummary["userCount"] == 1 ? "" : "s"}

View File

@ -1,6 +1,7 @@
<%@attribute name="pageName" required="false"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="security" uri="http://www.springframework.org/security/tags"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="o" tagdir="/WEB-INF/tags"%>
<c:choose>
<c:when test="${ not empty userInfo.preferredUsername }">
@ -39,34 +40,34 @@
<ul class="nav">
<c:choose>
<c:when test="${pageName == 'Home'}">
<li class="active"><a href="" data-toggle="collapse" data-target=".nav-collapse">Home</a></li>
<li class="active"><a href="" data-toggle="collapse" data-target=".nav-collapse"><spring:message code="home.title" text="Home"/></a></li>
</c:when>
<c:otherwise>
<li><a href="" data-toggle="collapse" data-target=".nav-collapse">Home</a></li>
<li><a href="" data-toggle="collapse" data-target=".nav-collapse"><spring:message code="home.title" text="Home"/></a></li>
</c:otherwise>
</c:choose>
<c:choose>
<c:when test="${pageName == 'About'}">
<li class="active" data-toggle="collapse" data-target=".nav-collapse"><a href="">About</a></li>
<li class="active" data-toggle="collapse" data-target=".nav-collapse"><a href=""><spring:message code="about.title" text="About"/></a></li>
</c:when>
<c:otherwise>
<li><a href="about" data-toggle="collapse" data-target=".nav-collapse">About</a></li>
<li><a href="about" data-toggle="collapse" data-target=".nav-collapse"><spring:message code="about.title" text="About"/></a></li>
</c:otherwise>
</c:choose>
<c:choose>
<c:when test="${pageName == 'Statistics'}">
<li class="active" data-toggle="collapse" data-target=".nav-collapse"><a href="">Statistics</a></li>
<li class="active" data-toggle="collapse" data-target=".nav-collapse"><a href=""><spring:message code="statistics.title" text="Statistics"/></a></li>
</c:when>
<c:otherwise>
<li><a href="stats" data-toggle="collapse" data-target=".nav-collapse">Statistics</a></li>
<li><a href="stats" data-toggle="collapse" data-target=".nav-collapse"><spring:message code="statistics.title" text="Statistics"/></a></li>
</c:otherwise>
</c:choose>
<c:choose>
<c:when test="${pageName == 'Contact'}">
<li class="active" data-toggle="collapse" data-target=".nav-collapse"><a href="">Contact</a></li>
<li class="active" data-toggle="collapse" data-target=".nav-collapse"><a href=""><spring:message code="contact.title" text="Contact"/></a></li>
</c:when>
<c:otherwise>
<li><a href="contact" data-toggle="collapse" data-target=".nav-collapse">Contact</a></li>
<li><a href="contact" data-toggle="collapse" data-target=".nav-collapse"><spring:message code="contact.title" text="Contact"/></a></li>
</c:otherwise>
</c:choose>
@ -87,13 +88,13 @@
<ul class="dropdown-menu pull-right">
<li><a href="manage/#user/profile" data-toggle="collapse" data-target=".nav-collapse">${ longName }</a></li>
<li class="divider"></li>
<li><a href="logout" data-toggle="collapse" data-target=".nav-collapse"><i class="icon-remove"></i> Log out</a></li>
<li><a href="logout" data-toggle="collapse" data-target=".nav-collapse"><i class="icon-remove"></i> <spring:message code="common.logout" text="Log out"/></a></li>
</ul>
</li>
</security:authorize>
<security:authorize access="!hasRole('ROLE_USER')">
<li>
<a id="loginButton" href="login" data-toggle="collapse" data-target=".nav-collapse"><i class="icon-lock icon-white"></i> Log in</a>
<a id="loginButton" href="login" data-toggle="collapse" data-target=".nav-collapse"><i class="icon-lock icon-white"></i> <spring:message code="common.login" text="Log in"/></a>
</li>
</security:authorize>
</ul>