mirror of
https://github.com/blakeblackshear/frigate.git
synced 2025-07-30 13:48:07 +02:00
Add i18n support to LogInfoDialog labels (#17979)
Integrated translations using `react-i18next` for LogInfoDialog component labels, ensuring proper localization. Updated static text labels (Type, Timestamp, Tag, Message) to dynamically rendered translation keys.
This commit is contained in:
parent
377b78af11
commit
d0de6f8326
@ -17,6 +17,7 @@ import {
|
|||||||
import { LogChip } from "../indicators/Chip";
|
import { LogChip } from "../indicators/Chip";
|
||||||
import { useMemo } from "react";
|
import { useMemo } from "react";
|
||||||
import { Link } from "react-router-dom";
|
import { Link } from "react-router-dom";
|
||||||
|
import { useTranslation } from "react-i18next";
|
||||||
|
|
||||||
type LogInfoDialogProps = {
|
type LogInfoDialogProps = {
|
||||||
logLine?: LogLine;
|
logLine?: LogLine;
|
||||||
@ -26,6 +27,7 @@ export default function LogInfoDialog({
|
|||||||
logLine,
|
logLine,
|
||||||
setLogLine,
|
setLogLine,
|
||||||
}: LogInfoDialogProps) {
|
}: LogInfoDialogProps) {
|
||||||
|
const { t } = useTranslation(["views/system"]);
|
||||||
const Overlay = isDesktop ? Sheet : Drawer;
|
const Overlay = isDesktop ? Sheet : Drawer;
|
||||||
const Content = isDesktop ? SheetContent : DrawerContent;
|
const Content = isDesktop ? SheetContent : DrawerContent;
|
||||||
const Header = isDesktop ? SheetHeader : DrawerHeader;
|
const Header = isDesktop ? SheetHeader : DrawerHeader;
|
||||||
@ -53,19 +55,27 @@ export default function LogInfoDialog({
|
|||||||
{logLine && (
|
{logLine && (
|
||||||
<div className="flex size-full flex-col gap-5">
|
<div className="flex size-full flex-col gap-5">
|
||||||
<div className="flex w-min flex-col gap-1.5">
|
<div className="flex w-min flex-col gap-1.5">
|
||||||
<div className="text-sm text-primary/40">Type</div>
|
<div className="text-sm text-primary/40">
|
||||||
|
{t("logs.type.label")}
|
||||||
|
</div>
|
||||||
<LogChip severity={logLine.severity} />
|
<LogChip severity={logLine.severity} />
|
||||||
</div>
|
</div>
|
||||||
<div className="flex flex-col gap-1.5">
|
<div className="flex flex-col gap-1.5">
|
||||||
<div className="text-sm text-primary/40">Timestamp</div>
|
<div className="text-sm text-primary/40">
|
||||||
|
{t("logs.type.timestamp")}
|
||||||
|
</div>
|
||||||
<div className="text-sm">{logLine.dateStamp}</div>
|
<div className="text-sm">{logLine.dateStamp}</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex flex-col gap-1.5">
|
<div className="flex flex-col gap-1.5">
|
||||||
<div className="text-sm text-primary/40">Tag</div>
|
<div className="text-sm text-primary/40">
|
||||||
|
{t("logs.type.tag")}
|
||||||
|
</div>
|
||||||
<div className="text-sm">{logLine.section}</div>
|
<div className="text-sm">{logLine.section}</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex flex-col gap-1.5">
|
<div className="flex flex-col gap-1.5">
|
||||||
<div className="text-sm text-primary/40">Message</div>
|
<div className="text-sm text-primary/40">
|
||||||
|
{t("logs.type.message")}
|
||||||
|
</div>
|
||||||
<div className="text-sm">
|
<div className="text-sm">
|
||||||
{logLine.content.split("\n").map((line) => (
|
{logLine.content.split("\n").map((line) => (
|
||||||
<>
|
<>
|
||||||
|
Loading…
Reference in New Issue
Block a user