Skip to content
This repository was archived by the owner on Sep 10, 2024. It is now read-only.

Commit e841ee2

Browse files
t3chguysandhose
authored andcommitted
Fix hardcoded English strings
1 parent 6fc4648 commit e841ee2

File tree

4 files changed

+72
-25
lines changed

4 files changed

+72
-25
lines changed

frontend/locales/en.json

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,19 @@
112112
},
113113
"session": {
114114
"current_badge": "Current",
115+
"device_id_label": "Device ID",
115116
"finished_date": "Finished <datetime/>",
116-
"signed_in_date": "Signed in <datetime/>"
117+
"finished_label": "Finished",
118+
"id_label": "ID",
119+
"ip_label": "IP Address",
120+
"last_active_label": "Last Active",
121+
"last_auth_label": "Last Authentication",
122+
"scopes_label": "Scopes",
123+
"signed_in_date": "Signed in <datetime/>",
124+
"signed_in_label": "Signed in",
125+
"uri_label": "Uri",
126+
"user_id_label": "User ID",
127+
"username_label": "User name"
117128
},
118129
"session_detail": {
119130
"alert": {

frontend/src/components/SessionDetail/BrowserSessionDetail.tsx

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,20 +70,25 @@ const BrowserSessionDetail: React.FC<Props> = ({ session }) => {
7070
const finishedAt = data.finishedAt
7171
? [
7272
{
73-
label: "Finished",
73+
label: t("frontend.session.finished_label"),
7474
value: <DateTime datetime={parseISO(data.finishedAt)} />,
7575
},
7676
]
7777
: [];
7878

7979
const lastActiveIp = data.lastActiveIp
80-
? [{ label: "IP Address", value: <code>{data.lastActiveIp}</code> }]
80+
? [
81+
{
82+
label: t("frontend.session.ip_label"),
83+
value: <code>{data.lastActiveIp}</code>,
84+
},
85+
]
8186
: [];
8287

8388
const lastActiveAt = data.lastActiveAt
8489
? [
8590
{
86-
label: "Last Active",
91+
label: t("frontend.session.last_active_label"),
8792
value: <LastActive lastActive={parseISO(data.lastActiveAt)} />,
8893
},
8994
]
@@ -92,7 +97,7 @@ const BrowserSessionDetail: React.FC<Props> = ({ session }) => {
9297
const lastAuthentication = data.lastAuthentication
9398
? [
9499
{
95-
label: "Last Authentication",
100+
label: t("frontend.session.last_auth_label"),
96101
value: (
97102
<DateTime datetime={parseISO(data.lastAuthentication.createdAt)} />
98103
),
@@ -101,10 +106,19 @@ const BrowserSessionDetail: React.FC<Props> = ({ session }) => {
101106
: [];
102107

103108
const sessionDetails = [
104-
{ label: "ID", value: <code>{data.id}</code> },
105-
{ label: "User ID", value: <code>{data.user.id}</code> },
106-
{ label: "User Name", value: <code>{data.user.username}</code> },
107-
{ label: "Signed in", value: <DateTime datetime={data.createdAt} /> },
109+
{ label: t("frontend.session.id_label"), value: <code>{data.id}</code> },
110+
{
111+
label: t("frontend.session.user_id_label"),
112+
value: <code>{data.user.id}</code>,
113+
},
114+
{
115+
label: t("frontend.session.username_label"),
116+
value: <code>{data.user.username}</code>,
117+
},
118+
{
119+
label: t("frontend.session.signed_in_label"),
120+
value: <DateTime datetime={data.createdAt} />,
121+
},
108122
...finishedAt,
109123
...lastActiveAt,
110124
...lastActiveIp,

frontend/src/components/SessionDetail/CompatSessionDetail.tsx

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,30 +58,38 @@ const CompatSessionDetail: React.FC<Props> = ({ session }) => {
5858
const finishedAt = data.finishedAt
5959
? [
6060
{
61-
label: "Finished",
61+
label: t("frontend.session.finished_label"),
6262
value: <DateTime datetime={parseISO(data.finishedAt)} />,
6363
},
6464
]
6565
: [];
6666

6767
const lastActiveIp = data.lastActiveIp
68-
? [{ label: "IP Address", value: <code>{data.lastActiveIp}</code> }]
68+
? [
69+
{
70+
label: t("frontend.session.ip_label"),
71+
value: <code>{data.lastActiveIp}</code>,
72+
},
73+
]
6974
: [];
7075

7176
const lastActiveAt = data.lastActiveAt
7277
? [
7378
{
74-
label: "Last Active",
79+
label: t("frontend.session.last_active_label"),
7580
value: <LastActive lastActive={parseISO(data.lastActiveAt)} />,
7681
},
7782
]
7883
: [];
7984

8085
const sessionDetails = [
81-
{ label: "ID", value: <code>{data.id}</code> },
82-
{ label: "Device ID", value: <code>{data.deviceId}</code> },
86+
{ label: t("frontend.session.id_label"), value: <code>{data.id}</code> },
87+
{
88+
label: t("frontend.session.device_id_label"),
89+
value: <code>{data.deviceId}</code>,
90+
},
8391
{
84-
label: "Signed in",
92+
label: t("frontend.session.signed_in_label"),
8593
value: <DateTime datetime={parseISO(data.createdAt)} />,
8694
},
8795
...finishedAt,
@@ -97,7 +105,7 @@ const CompatSessionDetail: React.FC<Props> = ({ session }) => {
97105
value: simplifyUrl(data.ssoLogin.redirectUri),
98106
});
99107
clientDetails.push({
100-
label: "Uri",
108+
label: t("frontend.session.uri_label"),
101109
value: (
102110
<ExternalLink target="_blank" href={data.ssoLogin?.redirectUri}>
103111
{data.ssoLogin?.redirectUri}

frontend/src/components/SessionDetail/OAuth2SessionDetail.tsx

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -67,34 +67,45 @@ const OAuth2SessionDetail: React.FC<Props> = ({ session }) => {
6767
const finishedAt = data.finishedAt
6868
? [
6969
{
70-
label: "Finished",
70+
label: t("frontend.session.finished_label"),
7171
value: <DateTime datetime={parseISO(data.finishedAt)} />,
7272
},
7373
]
7474
: [];
7575

7676
const lastActiveIp = data.lastActiveIp
77-
? [{ label: "IP Address", value: <code>{data.lastActiveIp}</code> }]
77+
? [
78+
{
79+
label: t("frontend.session.ip_label"),
80+
value: <code>{data.lastActiveIp}</code>,
81+
},
82+
]
7883
: [];
7984

8085
const lastActiveAt = data.lastActiveAt
8186
? [
8287
{
83-
label: "Last Active",
88+
label: t("frontend.session.last_active_label"),
8489
value: <LastActive lastActive={parseISO(data.lastActiveAt)} />,
8590
},
8691
]
8792
: [];
8893

8994
const sessionDetails = [
90-
{ label: "ID", value: <code>{data.id}</code> },
91-
{ label: "Device ID", value: <code>{deviceId}</code> },
92-
{ label: "Signed in", value: <DateTime datetime={data.createdAt} /> },
95+
{ label: t("frontend.session.id_label"), value: <code>{data.id}</code> },
96+
{
97+
label: t("frontend.session.device_id_label"),
98+
value: <code>{deviceId}</code>,
99+
},
100+
{
101+
label: t("frontend.session.signed_in_label"),
102+
value: <DateTime datetime={data.createdAt} />,
103+
},
93104
...finishedAt,
94105
...lastActiveAt,
95106
...lastActiveIp,
96107
{
97-
label: "Scopes",
108+
label: t("frontend.session.scopes_label"),
98109
value: (
99110
<span>
100111
{scopes.map((scope) => (
@@ -124,9 +135,12 @@ const OAuth2SessionDetail: React.FC<Props> = ({ session }) => {
124135
</>
125136
),
126137
},
127-
{ label: "ID", value: <code>{data.client.clientId}</code> },
128138
{
129-
label: "Uri",
139+
label: t("frontend.session.id_label"),
140+
value: <code>{data.client.clientId}</code>,
141+
},
142+
{
143+
label: t("frontend.session.uri_label"),
130144
value: (
131145
<a target="_blank" href={data.client.clientUri || undefined}>
132146
{data.client.clientUri}

0 commit comments

Comments
 (0)