mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-05-08 14:35:26 +03:00
locale sort object label switches
This commit is contained in:
parent
f9e4134381
commit
7856bf3ce2
@ -2,7 +2,7 @@
|
|||||||
import { WidgetProps } from "@rjsf/utils";
|
import { WidgetProps } from "@rjsf/utils";
|
||||||
import { SwitchesWidget } from "./SwitchesWidget";
|
import { SwitchesWidget } from "./SwitchesWidget";
|
||||||
import { FormContext } from "./SwitchesWidget";
|
import { FormContext } from "./SwitchesWidget";
|
||||||
import { getTranslatedLabel } from "@/utils/i18n";
|
import i18n, { getTranslatedLabel } from "@/utils/i18n";
|
||||||
import { FrigateConfig } from "@/types/frigateConfig";
|
import { FrigateConfig } from "@/types/frigateConfig";
|
||||||
import { JsonObject } from "@/types/configForm";
|
import { JsonObject } from "@/types/configForm";
|
||||||
|
|
||||||
@ -76,7 +76,12 @@ function getObjectLabels(context: FormContext): string[] {
|
|||||||
...sourceLabels,
|
...sourceLabels,
|
||||||
...formDataLabels,
|
...formDataLabels,
|
||||||
]);
|
]);
|
||||||
return [...combinedLabels].sort();
|
return [...combinedLabels].sort((a, b) =>
|
||||||
|
getObjectLabelDisplayName(a).localeCompare(
|
||||||
|
getObjectLabelDisplayName(b),
|
||||||
|
i18n.language,
|
||||||
|
),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getObjectLabelDisplayName(label: string): string {
|
function getObjectLabelDisplayName(label: string): string {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user