Update language support and localization across components. Change HTML language attribute to English, add i18next for translations, and refactor feedback forms to utilize localized strings. Remove unused constants and adjust product handling in lead forms. Enhance accessibility and improve code structure.

This commit is contained in:
2026-04-16 13:09:47 +05:00
parent 5007140a15
commit 7d1e0fe078
27 changed files with 1622 additions and 149 deletions
+26
View File
@@ -0,0 +1,26 @@
import { useQuery } from "@tanstack/react-query";
import ky from "ky";
import { useLocationSearch } from "@/hooks/useLocationSearch";
import { parseLangParam } from "@/lib/urlLang";
import { queryKeys } from "@/queries/keys";
const COUNTRY_CODE_URL = "https://stream.graff.tech/api/getCountryCode";
export async function fetchCountryCode(): Promise<{ countryCode: string }> {
return ky.get(COUNTRY_CODE_URL).json<{ countryCode: string }>();
}
export function useCountryCodeQuery() {
const search = useLocationSearch();
const langFromUrl = parseLangParam(
new URLSearchParams(search).get("lang")
);
return useQuery({
queryKey: queryKeys.countryCode,
queryFn: fetchCountryCode,
enabled: langFromUrl === null,
staleTime: 24 * 60 * 60 * 1000,
retry: 2,
});
}