Reverted all changes back to version 1d41f871ee
This commit is contained in:
@@ -1,35 +0,0 @@
|
||||
"use client";
|
||||
|
||||
import { useLocale } from "next-intl";
|
||||
import { useRouter, usePathname } from "next-intl/client";
|
||||
import {
|
||||
Select,
|
||||
SelectContent,
|
||||
SelectItem,
|
||||
SelectTrigger,
|
||||
SelectValue,
|
||||
} from "@/components/ui/select";
|
||||
import { useTranslations } from "next-intl";
|
||||
|
||||
export function LanguageSwitcher() {
|
||||
const t = useTranslations("LanguageSwitcher");
|
||||
const locale = useLocale();
|
||||
const router = useRouter();
|
||||
const pathname = usePathname();
|
||||
|
||||
const onSelectChange = (value: string) => {
|
||||
router.replace(pathname, { locale: value });
|
||||
};
|
||||
|
||||
return (
|
||||
<Select onValueChange={onSelectChange} defaultValue={locale}>
|
||||
<SelectTrigger className="w-[120px]">
|
||||
<SelectValue placeholder={t("placeholder")} />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem value="en">{t("en")}</SelectItem>
|
||||
<SelectItem value="de">{t("de")}</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user