feat: add Russian localization and independent STT languages
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
"use client";
|
||||
import { countLabel } from "@/src/core";
|
||||
import { useI18n } from "@/components/i18n";
|
||||
|
||||
|
||||
import { useState } from "react";
|
||||
import { ChevronRightIcon } from "lucide-react";
|
||||
@@ -21,9 +24,10 @@ export interface GraphContextData {
|
||||
}
|
||||
|
||||
export function GraphContextCard({ data }: { data: GraphContextData }) {
|
||||
const { t, language } = useI18n();
|
||||
const [open, setOpen] = useState(false);
|
||||
const { propositions = [], chains = [] } = data ?? {};
|
||||
const noun = (n: number, one: string, many: string) => `${n} ${n === 1 ? one : many}`;
|
||||
const noun = (n: number, one: string, many: string) => countLabel(language, n, one, many);
|
||||
return (
|
||||
<div data-testid="graph-context-card" className="my-1">
|
||||
<button
|
||||
@@ -33,7 +37,7 @@ export function GraphContextCard({ data }: { data: GraphContextData }) {
|
||||
className="flex w-full cursor-pointer items-center gap-2 rounded-lg border border-dashed border-border/70 px-3 py-2 text-left text-xs text-muted-foreground transition-colors hover:text-foreground"
|
||||
>
|
||||
<ChevronRightIcon aria-hidden="true" className={cn("size-3.5 shrink-0 transition-transform", open && "rotate-90")} />
|
||||
<span className="font-medium">Graph context</span>
|
||||
<span className="font-medium">{t("Graph context")}</span>
|
||||
<span className="min-w-0 flex-1 truncate">
|
||||
{noun(propositions.length, "proposition", "propositions")}
|
||||
{chains.length > 0 ? ` · ${noun(chains.length, "chain", "chains")}` : ""}
|
||||
|
||||
Reference in New Issue
Block a user