Update localization files + references (#4556)
* Initial plan * Add localization support to NameChangeModal component Co-authored-by: gabek <414923+gabek@users.noreply.github.com> * Add NameChangeModal translations to English language file Co-authored-by: gabek <414923+gabek@users.noreply.github.com> * fix(i18n): fix localization keys * chore(test): add i18n test * chore(i18n): update translation script * chore(i18n): reorgnize translation keys and update components * chore: fix linting warnings * chore(i18n): update all the language files * feat(i18n): add last live ago i18n key --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: gabek <414923+gabek@users.noreply.github.com> Co-authored-by: Gabe Kangas <gabek@real-ity.com>
This commit is contained in:
co-authored by
gabek
copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Gabe Kangas
parent
401b5897e2
commit
1cf923a5af
@@ -12,6 +12,7 @@ import { ServerStatusContext } from '../../utils/server-status-context';
|
||||
import { VIEWERS_OVER_TIME, ACTIVE_VIEWER_DETAILS, fetchData } from '../../utils/apis';
|
||||
|
||||
import { AdminLayout } from '../../components/layouts/AdminLayout';
|
||||
import { Localization } from '../../types/localization';
|
||||
|
||||
// Lazy loaded components
|
||||
|
||||
@@ -36,13 +37,13 @@ export default function ViewersOverTime() {
|
||||
}
|
||||
|
||||
const times = [
|
||||
{ title: t('Current stream'), start: streamStart },
|
||||
{ title: t('Last 12 hours'), start: sub(new Date(), { hours: 12 }) },
|
||||
{ title: t('Last 24 hours'), start: sub(new Date(), { hours: 24 }) },
|
||||
{ title: t('Last 7 days'), start: sub(new Date(), { days: 7 }) },
|
||||
{ title: t('Last 30 days'), start: sub(new Date(), { days: 30 }) },
|
||||
{ title: t('Last 3 months'), start: sub(new Date(), { months: 3 }) },
|
||||
{ title: t('Last 6 months'), start: sub(new Date(), { months: 6 }) },
|
||||
{ title: t(Localization.Admin.ViewerInfo.currentStream), start: streamStart },
|
||||
{ title: t(Localization.Admin.ViewerInfo.last12Hours), start: sub(new Date(), { hours: 12 }) },
|
||||
{ title: t(Localization.Admin.ViewerInfo.last24Hours), start: sub(new Date(), { hours: 24 }) },
|
||||
{ title: t(Localization.Admin.ViewerInfo.last7Days), start: sub(new Date(), { days: 7 }) },
|
||||
{ title: t(Localization.Admin.ViewerInfo.last30Days), start: sub(new Date(), { days: 30 }) },
|
||||
{ title: t(Localization.Admin.ViewerInfo.last3Months), start: sub(new Date(), { months: 3 }) },
|
||||
{ title: t(Localization.Admin.ViewerInfo.last6Months), start: sub(new Date(), { months: 6 }) },
|
||||
];
|
||||
|
||||
const [loadingChart, setLoadingChart] = useState(true);
|
||||
@@ -96,13 +97,13 @@ export default function ViewersOverTime() {
|
||||
|
||||
return (
|
||||
<>
|
||||
<Typography.Title>{t('Viewer Info')}</Typography.Title>
|
||||
<Typography.Title>{t(Localization.Admin.ViewerInfo.title)}</Typography.Title>
|
||||
<br />
|
||||
<Row gutter={[16, 16]} justify="space-around">
|
||||
{online && (
|
||||
<Col span={8} md={8}>
|
||||
<StatisticItem
|
||||
title={t('Current viewers')}
|
||||
title={t(Localization.Admin.ViewerInfo.currentViewers)}
|
||||
value={viewerCount.toString()}
|
||||
prefix={<UserOutlined />}
|
||||
/>
|
||||
@@ -110,14 +111,18 @@ export default function ViewersOverTime() {
|
||||
)}
|
||||
<Col md={online ? 8 : 12}>
|
||||
<StatisticItem
|
||||
title={online ? t('Max viewers this stream') : t('Max viewers last stream')}
|
||||
title={
|
||||
online
|
||||
? t(Localization.Admin.ViewerInfo.maxViewersThisStream)
|
||||
: t(Localization.Admin.ViewerInfo.maxViewersLastStream)
|
||||
}
|
||||
value={sessionPeakViewerCount.toString()}
|
||||
prefix={<UserOutlined />}
|
||||
/>
|
||||
</Col>
|
||||
<Col md={online ? 8 : 12}>
|
||||
<StatisticItem
|
||||
title={t('max viewers')}
|
||||
title={t(Localization.Admin.ViewerInfo.maxViewers)}
|
||||
value={overallPeakViewerCount.toString()}
|
||||
prefix={<UserOutlined />}
|
||||
/>
|
||||
@@ -127,8 +132,8 @@ export default function ViewersOverTime() {
|
||||
<Alert
|
||||
style={{ marginTop: '10px' }}
|
||||
banner
|
||||
message={t('Please wait')}
|
||||
description={t('No viewer data has been collected yet.')}
|
||||
message={t(Localization.Admin.ViewerInfo.pleaseWait)}
|
||||
description={t(Localization.Admin.ViewerInfo.noData)}
|
||||
type="info"
|
||||
/>
|
||||
)}
|
||||
@@ -136,7 +141,7 @@ export default function ViewersOverTime() {
|
||||
<Spin spinning={!viewerInfo.length || loadingChart}>
|
||||
{viewerInfo.length > 0 && (
|
||||
<Chart
|
||||
title={t('Viewers')}
|
||||
title={t(Localization.Admin.ViewerInfo.viewers)}
|
||||
data={viewerInfo}
|
||||
color="#2087E2"
|
||||
unit="viewers"
|
||||
|
||||
Reference in New Issue
Block a user