Translate statistics, first version.

pull/763/head
Fredrik Jönsson 2015-02-04 21:09:01 +01:00
parent 55bc8713ef
commit 3533dcdee9
4 changed files with 23 additions and 30 deletions

View File

@ -11,6 +11,9 @@ More information about the project can be found at \
There, you can submit bug reports, give feedback, or even contribute code patches for additional features you'd like to see. There, you can submit bug reports, give feedback, or even contribute code patches for additional features you'd like to see.
statistics.title=Statistics statistics.title=Statistics
statistics.number_users=Number of users: <span class="label label-info" id="userCount">{0}</span>.
statistics.number_clients=Authorized clients: <span class="label label-info" id="clientCount">{0}</span>.
statistics.number_approvals=Approved sites: <span class="label label-info" id="approvalCount">{0}</span>.</p>
home.title=Home home.title=Home
home.welcome=Welcome! home.welcome=Welcome!
@ -28,6 +31,9 @@ For more information or support, contact the administrators of this system.</p>\
<p><a class="btn" href="mailto:idp@example.com?Subject=OpenID Connect">Email &raquo;</a> <p><a class="btn" href="mailto:idp@example.com?Subject=OpenID Connect">Email &raquo;</a>
home.statistics=Current Statistics home.statistics=Current Statistics
home.statistics.loading=Loading... home.statistics.loading=Loading...
home.statistics.number_users=Number of users: <span class="label label-info" id="userCount">{0}</span>.
home.statistics.number_clients=Authorized clients: <span class="label label-info" id="clientCount">{0}</span>.
home.statistics.number_approvals=Approved sites: <span class="label label-info" id="approvalCount">{0}</span>.</p>
contact.title=Contact contact.title=Contact
contact.body=To report bugs with the MITREid Connect software itself, use the \ contact.body=To report bugs with the MITREid Connect software itself, use the \

View File

@ -11,6 +11,9 @@ Mer information om projektet kan finns i projektet \
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. 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.
statistics.title=Statistik statistics.title=Statistik
statistics.number_users=Antal användare: <span class="label label-info" id="userCount">{0}</span>.
statistics.number_clients=Auktoriserade klienter: <span class="label label-info" id="clientCount">{0}</span>.
statistics.number_approvals=Godkända webbplatser: <span class="label label-info" id="approvalCount">{0}</span>.</p>
home.title=Hem home.title=Hem
home.welcome=Välkommen! home.welcome=Välkommen!
@ -29,6 +32,9 @@ För mer information eller användarstöd, kontakta administratörerna av detta
<p><a class="btn" href="mailto:idp@example.com?Subject=OpenID Connect">E-post &raquo;</a> <p><a class="btn" href="mailto:idp@example.com?Subject=OpenID Connect">E-post &raquo;</a>
home.statistics=Nuvarande statistik home.statistics=Nuvarande statistik
home.statistics.loading=Laddar... home.statistics.loading=Laddar...
home.statistics.number_users=Antal användare: <span class="label label-info" id="userCount">{0}</span>.
home.statistics.number_clients=Auktoriserade klienter: <span class="label label-info" id="clientCount">{0}</span>.
home.statistics.number_approvals=Godkända webbplatser: <span class="label label-info" id="approvalCount">{0}</span>.</p>
contact.title=Kontakt contact.title=Kontakt
contact.body=\ contact.body=\

View File

@ -3,43 +3,25 @@
<p id="statsloader" class="muted"><spring:message code="home.statistics.loading"/></p> <p id="statsloader" class="muted"><spring:message code="home.statistics.loading"/></p>
<p id="stats">There have been <p id="stats">
<span class="label label-info" id="userCount">?</span> <span id="userCountLabel">user</span> <spring:message code="home.statistics.number_users" arguments="?"/>
of this system who have authorized <spring:message code="home.statistics.number_clients" arguments="?"/>
<span class="label label-info" id="clientCount">?</span> <span id="clientCountLabel">application</span>, <spring:message code="home.statistics.number_approvals" arguments="?"/>
with a total of </p>
<span class="label label-info" id="approvalCount">?</span> site <span id="approvalCountLabel">approval</span>.</p>
<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function() { $(document).ready(function() {
$('#stats').hide(); $('#stats').hide();
var base = $('base').attr('href'); var base = $('base').attr('href');
$.getJSON(base + 'api/stats/summary', function(data) { $.getJSON(base + 'api/stats/summary', function(data) {
var stats = data; var stats = data;
$('#userCount').html(stats.userCount); $('#userCount').html(stats.userCount);
if (stats.userCount != 1) {
$('#userCountLabel').append('s');
}
$('#clientCount').html(stats.clientCount); $('#clientCount').html(stats.clientCount);
if (stats.clientCount != 1) {
$('#clientCountLabel').append('s');
}
$('#approvalCount').html(stats.approvalCount); $('#approvalCount').html(stats.approvalCount);
if (stats.approvalCount != 1) {
$('#approvalCountLabel').append('s');
}
$('#statsloader').hide(); $('#statsloader').hide();
$('#stats').show(); $('#stats').show();
}); });
}); });
</script> </script>

View File

@ -1,9 +1,8 @@
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%> <%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<h2><spring:message code="statistics.title"/></h2> <h2><spring:message code="statistics.title"/></h2>
<p>There have been <p>
<span class="label label-info">${statsSummary["userCount"]}</span> user${statsSummary["userCount"] == 1 ? "" : "s"} <spring:message code="statistics.number_users" arguments='${statsSummary["userCount"]}'/>
of this system who have logged in to <spring:message code="statistics.number_clients" arguments='${statsSummary["clientCount"]}'/>
<span class="label label-info">${statsSummary["clientCount"]}</span> total site${statsSummary["clientCount"] == 1 ? "" : "s"}, <spring:message code="statistics.number_approvals" arguments='${statsSummary["approvalCount"]}'/>
for a total of </p>
<span class="label label-info">${statsSummary["approvalCount"]}</span> site approval${statsSummary["approvalCount"] == 1 ? "" : "s"}.</p>