Skip to content

Commit

Permalink
localize sessions page
Browse files Browse the repository at this point in the history
  • Loading branch information
josxha committed Oct 20, 2023
1 parent 6bd021b commit d9b356f
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 14 deletions.
27 changes: 27 additions & 0 deletions KratosSelfService/Resources/CustomTranslator.de.resx
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,31 @@
<data name="Logout" xml:space="preserve">
<value>Abmelden</value>
</data>
<data name="sessions.title" xml:space="preserve">
<value>Aktive Sitzungen</value>
</data>
<data name="sessions.devices" xml:space="preserve">
<value>Geräte</value>
</data>
<data name="sessions.authenticatedWith" xml:space="preserve">
<value>Authentifiziert mit</value>
</data>
<data name="sessions.authenticatedAt" xml:space="preserve">
<value>Authentifiziert am</value>
</data>
<data name="sessions.expiresAt" xml:space="preserve">
<value>Läuft ab am</value>
</data>
<data name="sessions.noOtherActiveSessions" xml:space="preserve">
<value>Es gibt eine weiteren aktiven Sitzungen</value>
</data>
<data name="sessions.otherSessions" xml:space="preserve">
<value>Weitere Sitzungen</value>
</data>
<data name="sessions.logoutOtherSessions" xml:space="preserve">
<value>Alle anderen Sitzungen abmelden</value>
</data>
<data name="sessions.currentSession" xml:space="preserve">
<value>Diese Sitzung</value>
</data>
</root>
27 changes: 27 additions & 0 deletions KratosSelfService/Resources/CustomTranslator.en.resx
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,31 @@
<data name="en" xml:space="preserve">
<value>en</value>
</data>
<data name="sessions.title" xml:space="preserve">
<value>Active sessions</value>
</data>
<data name="sessions.devices" xml:space="preserve">
<value>Devices</value>
</data>
<data name="sessions.authenticatedWith" xml:space="preserve">
<value>Authenticated with</value>
</data>
<data name="sessions.authenticatedAt" xml:space="preserve">
<value>Authenticated at</value>
</data>
<data name="sessions.expiresAt" xml:space="preserve">
<value>Expires at</value>
</data>
<data name="sessions.noOtherActiveSessions" xml:space="preserve">
<value>There are no other active sessions.</value>
</data>
<data name="sessions.otherSessions" xml:space="preserve">
<value>Other Sessions</value>
</data>
<data name="sessions.logoutOtherSessions" xml:space="preserve">
<value>Logout all other sessions</value>
</data>
<data name="sessions.currentSession" xml:space="preserve">
<value>Current Session</value>
</data>
</root>
28 changes: 14 additions & 14 deletions KratosSelfService/Views/Sessions/Sessions.cshtml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
@model SessionsModel
@{
ViewData["Title"] = "Sessions";
ViewData["Title"] = CustomTranslator.Get("sessions.title");
var totalSessions = Model.OtherSessions.Count + 1;
}

<section class="section">
<h1 class="title">User Sessions</h1>
<h1 class="title">@CustomTranslator.Get("sessions.title")</h1>
<h2 class="subtitle">You have @totalSessions active session@(totalSessions == 1 ? "" : "s").</h2>
<h4 class="title mt-3">Current Session</h4>
<h4 class="title mt-3">@CustomTranslator.Get("sessions.currentSession")</h4>
<table class="table is-fullwidth">
<thead>
<tr>
<td>Devices</td>
<td>Authentication Methods</td>
<td>Authenticated At</td>
<td>Expires At</td>
<td>@CustomTranslator.Get("sessions.devices")</td>
<td>@CustomTranslator.Get("sessions.authenticatedWith")</td>
<td>@CustomTranslator.Get("sessions.authenticatedAt")</td>
<td>@CustomTranslator.Get("sessions.expiresAt")</td>
</tr>
</thead>
<tbody>
Expand All @@ -26,25 +26,25 @@
</tr>
</tbody>
</table>
<h4 class="title mt-3">Other Sessions</h4>
<h4 class="title mt-3">@CustomTranslator.Get("sessions.otherSessions")</h4>
@if (Model.OtherSessions.Count == 0)
{
<p>There are no other active sessions.</p>
<p>@CustomTranslator.Get("sessions.noOtherActiveSessions")</p>
}
else
{
<div class="buttons">
<a class="button is-warning" href="sessions-logout">
Logout all other sessions
@CustomTranslator.Get("sessions.logoutOtherSessions")
</a>
</div>
<table class="table is-fullwidth">
<thead>
<tr>
<td>Devices</td>
<td>Authentication Methods</td>
<td>Authenticated At</td>
<td>Expires At</td>
<td>@CustomTranslator.Get("sessions.devices")</td>
<td>@CustomTranslator.Get("sessions.authenticationMethods")</td>
<td>@CustomTranslator.Get("sessions.authenticatedAt")</td>
<td>@CustomTranslator.Get("sessions.expiresAt")</td>
</tr>
</thead>
<tbody>
Expand Down

0 comments on commit d9b356f

Please sign in to comment.