mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-15 17:45:54 +08:00
feat: i18n support for setting route names
This commit is contained in:
parent
95f8dfb4bc
commit
42842b6b17
@ -1,5 +1,9 @@
|
|||||||
{
|
{
|
||||||
"monitor_signup": "Monitor your applications. Find what is causing issues.",
|
"monitor_signup": "Monitor your applications. Find what is causing issues.",
|
||||||
|
"routes": {
|
||||||
|
"general": "General",
|
||||||
|
"alert_channels": "Alert Channels"
|
||||||
|
},
|
||||||
"settings": {
|
"settings": {
|
||||||
"total_retention_period": "Total Retention Period",
|
"total_retention_period": "Total Retention Period",
|
||||||
"move_to_s3": "Move to S3\n(should be lower than total retention period)",
|
"move_to_s3": "Move to S3\n(should be lower than total retention period)",
|
||||||
|
@ -5,28 +5,32 @@ import CreateAlertChannels from 'container/CreateAlertChannels';
|
|||||||
import GeneralSettings from 'container/GeneralSettings';
|
import GeneralSettings from 'container/GeneralSettings';
|
||||||
import history from 'lib/history';
|
import history from 'lib/history';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
function SettingsPage(): JSX.Element {
|
function SettingsPage(): JSX.Element {
|
||||||
const pathName = history.location.pathname;
|
const pathName = history.location.pathname;
|
||||||
|
const { t } = useTranslation();
|
||||||
return (
|
return (
|
||||||
<RouteTab
|
<RouteTab
|
||||||
{...{
|
{...{
|
||||||
routes: [
|
routes: [
|
||||||
{
|
{
|
||||||
Component: GeneralSettings,
|
Component: GeneralSettings,
|
||||||
name: 'General',
|
name: t('routes.general'),
|
||||||
route: ROUTES.SETTINGS,
|
route: ROUTES.SETTINGS,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Component: (): JSX.Element => {
|
Component: (): JSX.Element => {
|
||||||
return <CreateAlertChannels preType="slack" />;
|
return <CreateAlertChannels preType="slack" />;
|
||||||
},
|
},
|
||||||
name: 'Alert Channels',
|
name: t('routes.alert_channels'),
|
||||||
route: ROUTES.ALL_CHANNELS,
|
route: ROUTES.ALL_CHANNELS,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
activeKey: pathName === ROUTES.SETTINGS ? 'General' : 'Alert Channels',
|
activeKey:
|
||||||
|
pathName === ROUTES.SETTINGS
|
||||||
|
? t('routes.general')
|
||||||
|
: t('routes.alert_channels'),
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
@ -4,26 +4,30 @@ import AlertChannels from 'container/AllAlertChannels';
|
|||||||
import GeneralSettings from 'container/GeneralSettings';
|
import GeneralSettings from 'container/GeneralSettings';
|
||||||
import history from 'lib/history';
|
import history from 'lib/history';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
function AllAlertChannels(): JSX.Element {
|
function AllAlertChannels(): JSX.Element {
|
||||||
const pathName = history.location.pathname;
|
const pathName = history.location.pathname;
|
||||||
|
const { t } = useTranslation();
|
||||||
return (
|
return (
|
||||||
<RouteTab
|
<RouteTab
|
||||||
{...{
|
{...{
|
||||||
routes: [
|
routes: [
|
||||||
{
|
{
|
||||||
Component: GeneralSettings,
|
Component: GeneralSettings,
|
||||||
name: 'General',
|
name: t('routes.general'),
|
||||||
route: ROUTES.SETTINGS,
|
route: ROUTES.SETTINGS,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Component: AlertChannels,
|
Component: AlertChannels,
|
||||||
name: 'Alert Channels',
|
name: t('routes.alert_channels'),
|
||||||
route: ROUTES.ALL_CHANNELS,
|
route: ROUTES.ALL_CHANNELS,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
activeKey: pathName === ROUTES.SETTINGS ? 'General' : 'Alert Channels',
|
activeKey:
|
||||||
|
pathName === ROUTES.SETTINGS
|
||||||
|
? t('routes.general')
|
||||||
|
: t('routes.alert_channels'),
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user