mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-08-02 17:12:16 +03:00
Implement smart capitalization based on locale (#17860)
This commit is contained in:
@@ -572,7 +572,7 @@ export default function ObjectLifecycle({
|
||||
</div>
|
||||
</div>
|
||||
<div className="mx-3 text-lg">
|
||||
<div className="flex flex-row items-center capitalize text-primary">
|
||||
<div className="flex flex-row items-center text-primary smart-capitalize">
|
||||
{getLifecycleItemDescription(item)}
|
||||
</div>
|
||||
<div className="text-sm text-primary-variant">
|
||||
@@ -616,7 +616,7 @@ export default function ObjectLifecycle({
|
||||
)}
|
||||
<div
|
||||
key={index}
|
||||
className="cursor-pointer capitalize"
|
||||
className="cursor-pointer smart-capitalize"
|
||||
onClick={() => setSelectedZone(zone)}
|
||||
>
|
||||
{zone.replaceAll("_", " ")}
|
||||
@@ -722,7 +722,7 @@ export default function ObjectLifecycle({
|
||||
/>
|
||||
</TooltipTrigger>
|
||||
<TooltipPortal>
|
||||
<TooltipContent className="capitalize">
|
||||
<TooltipContent className="smart-capitalize">
|
||||
{getLifecycleItemDescription(item)}
|
||||
</TooltipContent>
|
||||
</TooltipPortal>
|
||||
|
||||
@@ -100,7 +100,7 @@ export function ObjectPath({
|
||||
/>
|
||||
</TooltipTrigger>
|
||||
<TooltipPortal>
|
||||
<TooltipContent side="top" className="capitalize">
|
||||
<TooltipContent side="top" className="smart-capitalize">
|
||||
{pos.lifecycle_item
|
||||
? getLifecycleItemDescription(pos.lifecycle_item)
|
||||
: "Tracked point"}
|
||||
|
||||
@@ -223,7 +223,9 @@ export default function ObjectPathPlotter() {
|
||||
}}
|
||||
/>
|
||||
<span className="text-sm">
|
||||
<strong className="mr-1 capitalize">{event.label}</strong>
|
||||
<strong className="mr-1 smart-capitalize">
|
||||
{event.label}
|
||||
</strong>
|
||||
{formatUnixTimestampToDateTime(event.start_time, {
|
||||
timezone: config?.ui.timezone,
|
||||
})}
|
||||
|
||||
@@ -233,7 +233,7 @@ export default function ReviewDetailDialog({
|
||||
<div className="text-sm text-primary/40">
|
||||
{t("details.camera")}
|
||||
</div>
|
||||
<div className="text-sm capitalize">
|
||||
<div className="text-sm smart-capitalize">
|
||||
{review.camera.replaceAll("_", " ")}
|
||||
</div>
|
||||
</div>
|
||||
@@ -249,12 +249,12 @@ export default function ReviewDetailDialog({
|
||||
<div className="text-sm text-primary/40">
|
||||
{t("details.objects")}
|
||||
</div>
|
||||
<div className="scrollbar-container flex max-h-32 flex-col items-start gap-2 overflow-y-auto text-sm capitalize">
|
||||
<div className="scrollbar-container flex max-h-32 flex-col items-start gap-2 overflow-y-auto text-sm smart-capitalize">
|
||||
{events?.map((event) => {
|
||||
return (
|
||||
<div
|
||||
key={event.id}
|
||||
className="flex flex-row items-center gap-2 capitalize"
|
||||
className="flex flex-row items-center gap-2 smart-capitalize"
|
||||
>
|
||||
{getIconForLabel(
|
||||
event.label,
|
||||
@@ -290,12 +290,12 @@ export default function ReviewDetailDialog({
|
||||
<div className="text-sm text-primary/40">
|
||||
{t("details.zones")}
|
||||
</div>
|
||||
<div className="flex flex-col items-start gap-2 text-sm capitalize">
|
||||
<div className="flex flex-col items-start gap-2 text-sm smart-capitalize">
|
||||
{review.data.zones.map((zone) => {
|
||||
return (
|
||||
<div
|
||||
key={zone}
|
||||
className="flex flex-row items-center gap-2 capitalize"
|
||||
className="flex flex-row items-center gap-2 smart-capitalize"
|
||||
>
|
||||
{zone.replaceAll("_", " ")}
|
||||
</div>
|
||||
|
||||
@@ -231,7 +231,7 @@ export default function SearchDetailDialog({
|
||||
{item == "object_lifecycle" && (
|
||||
<FaRotate className="size-4" />
|
||||
)}
|
||||
<div className="capitalize">{t(`type.${item}`)}</div>
|
||||
<div className="smart-capitalize">{t(`type.${item}`)}</div>
|
||||
</ToggleGroupItem>
|
||||
))}
|
||||
</ToggleGroup>
|
||||
@@ -711,7 +711,7 @@ function ObjectDetailsTab({
|
||||
<div className="flex w-full flex-col gap-3">
|
||||
<div className="flex flex-col gap-1.5">
|
||||
<div className="text-sm text-primary/40">{t("details.label")}</div>
|
||||
<div className="flex flex-row items-center gap-2 text-sm capitalize">
|
||||
<div className="flex flex-row items-center gap-2 text-sm smart-capitalize">
|
||||
{getIconForLabel(search.label, "size-4 text-primary")}
|
||||
{t(search.label, {
|
||||
ns: "objects",
|
||||
@@ -831,7 +831,7 @@ function ObjectDetailsTab({
|
||||
)}
|
||||
<div className="flex flex-col gap-1.5">
|
||||
<div className="text-sm text-primary/40">{t("details.camera")}</div>
|
||||
<div className="text-sm capitalize">
|
||||
<div className="text-sm smart-capitalize">
|
||||
{search.camera.replaceAll("_", " ")}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user