i18n integration for showcase
Moved showcase carousel data source to respective i18n/ language files
This commit is contained in:
		@@ -8,6 +8,6 @@ const { title, description } = dictionary[Astro.currentLocale];
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
<SinglePage>
 | 
					<SinglePage>
 | 
				
			||||||
    <div class="flex flex-col h-screen">
 | 
					    <div class="flex flex-col h-screen">
 | 
				
			||||||
        <ShowcaseTabs client:load />
 | 
					        <ShowcaseTabs currentLocale={Astro.currentLocale} client:load />
 | 
				
			||||||
    </div>
 | 
					    </div>
 | 
				
			||||||
</SinglePage>
 | 
					</SinglePage>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -12,20 +12,22 @@ import {
 | 
				
			|||||||
  TabsTrigger,
 | 
					  TabsTrigger,
 | 
				
			||||||
} from "../components/ui/tabs";
 | 
					} from "../components/ui/tabs";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import { data } from "../content/showcase";
 | 
					import { dictionary } from "../i18n/dictionary";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export function ShowcaseTabs() {
 | 
					
 | 
				
			||||||
 | 
					export function ShowcaseTabs({ currentLocale }) {
 | 
				
			||||||
 | 
					  const { showcase } = dictionary[currentLocale];
 | 
				
			||||||
  return (
 | 
					  return (
 | 
				
			||||||
    <Tabs
 | 
					    <Tabs
 | 
				
			||||||
      defaultValue={data[0].value}
 | 
					      defaultValue={showcase[0].value}
 | 
				
			||||||
      className="bottom-0 flex flex-col h-full my-auto"
 | 
					      className="bottom-0 flex flex-col h-full my-auto"
 | 
				
			||||||
    >
 | 
					    >
 | 
				
			||||||
      <TabsList className={`grid w-full mt-4 grid-cols-${data.length}`}>
 | 
					      <TabsList className={`grid w-full mt-4 grid-cols-${showcase.length}`}>
 | 
				
			||||||
        {data.map((item) => (
 | 
					        {showcase.map((item) => (
 | 
				
			||||||
          <TabsTrigger value={item.value} key={item.value}>{item.handle}</TabsTrigger>
 | 
					          <TabsTrigger value={item.value} key={item.value}>{item.handle}</TabsTrigger>
 | 
				
			||||||
        ))}
 | 
					        ))}
 | 
				
			||||||
      </TabsList>
 | 
					      </TabsList>
 | 
				
			||||||
      {data.map((item) => (
 | 
					      {showcase.map((item) => (
 | 
				
			||||||
        <TabsContent value={item.value} className="h-full" key={item.value}>
 | 
					        <TabsContent value={item.value} className="h-full" key={item.value}>
 | 
				
			||||||
          <Card className="h-[90%] my-auto">
 | 
					          <Card className="h-[90%] my-auto">
 | 
				
			||||||
            <CardHeader>
 | 
					            <CardHeader>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,29 +0,0 @@
 | 
				
			|||||||
export const data = [
 | 
					 | 
				
			||||||
	{
 | 
					 | 
				
			||||||
	  value: "thisPage",
 | 
					 | 
				
			||||||
	  handle: "Projekt 1",
 | 
					 | 
				
			||||||
	  title: "This Page",
 | 
					 | 
				
			||||||
	  href: "/potato",
 | 
					 | 
				
			||||||
	  description: "random text os iuoiu fsd ufiodsu foid sufo dsufois dufoisd eee sfsdffsdfsd sd sd ds dsfsv sd dss ds ds ufiosdufi osdufsdfsd iofusdoifudu siofsdfids ofudsiouoi",
 | 
					 | 
				
			||||||
	  image: "/temp.jpg", 
 | 
					 | 
				
			||||||
	  imageAlt: "text" 
 | 
					 | 
				
			||||||
	},
 | 
					 | 
				
			||||||
	{
 | 
					 | 
				
			||||||
	  value: "thatPage",
 | 
					 | 
				
			||||||
	  title: "That Page",
 | 
					 | 
				
			||||||
	  handle: "Projekt 2",
 | 
					 | 
				
			||||||
	  href: "/potat2",
 | 
					 | 
				
			||||||
	  description: "random text",
 | 
					 | 
				
			||||||
	  image: "/temp.jpg", 
 | 
					 | 
				
			||||||
	  imageAlt: "text" 
 | 
					 | 
				
			||||||
	},
 | 
					 | 
				
			||||||
	{
 | 
					 | 
				
			||||||
	  value: "otherPage",
 | 
					 | 
				
			||||||
	  title: "Other Page",
 | 
					 | 
				
			||||||
	  handle: "Projekt 3",
 | 
					 | 
				
			||||||
	  href: "/kartoffeln",
 | 
					 | 
				
			||||||
	  description: "random text",
 | 
					 | 
				
			||||||
	  image: "/temp.jpg", 
 | 
					 | 
				
			||||||
	  imageAlt: "text" 
 | 
					 | 
				
			||||||
	},
 | 
					 | 
				
			||||||
  ];
 | 
					 | 
				
			||||||
@@ -1,3 +1,33 @@
 | 
				
			|||||||
export const cs = {
 | 
					export const cs = {
 | 
				
			||||||
  title: "CS Test",
 | 
					  title: "CS Test",
 | 
				
			||||||
 | 
					  showcase: [
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					      value: "thisPage",
 | 
				
			||||||
 | 
					      handle: "Projekt 1",
 | 
				
			||||||
 | 
					      title: "This Page",
 | 
				
			||||||
 | 
					      href: "/potato",
 | 
				
			||||||
 | 
					      description:
 | 
				
			||||||
 | 
					        "random text os iuoiu fsd ufiodsu foid sufo dsufois dufoisd eee sfsdffsdfsd sd sd ds dsfsv sd dss ds ds ufiosdufi osdufsdfsd iofusdoifudu siofsdfids ofudsiouoi",
 | 
				
			||||||
 | 
					      image: "/temp.jpg",
 | 
				
			||||||
 | 
					      imageAlt: "text",
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					      value: "thatPage",
 | 
				
			||||||
 | 
					      title: "That Page",
 | 
				
			||||||
 | 
					      handle: "Projekt 2",
 | 
				
			||||||
 | 
					      href: "/potat2",
 | 
				
			||||||
 | 
					      description: "random text",
 | 
				
			||||||
 | 
					      image: "/temp.jpg",
 | 
				
			||||||
 | 
					      imageAlt: "text",
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					      value: "otherPage",
 | 
				
			||||||
 | 
					      title: "Other Page",
 | 
				
			||||||
 | 
					      handle: "Projekt 3",
 | 
				
			||||||
 | 
					      href: "/kartoffeln",
 | 
				
			||||||
 | 
					      description: "random text",
 | 
				
			||||||
 | 
					      image: "/temp.jpg",
 | 
				
			||||||
 | 
					      imageAlt: "text",
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					  ],
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
@@ -1,3 +1,34 @@
 | 
				
			|||||||
export const de = {
 | 
					export const de = {
 | 
				
			||||||
	title: "DE Test",
 | 
						title: "DE Test",
 | 
				
			||||||
 | 
						showcase: [
 | 
				
			||||||
 | 
						  {
 | 
				
			||||||
 | 
							value: "thisPage",
 | 
				
			||||||
 | 
							handle: "Projekt 1 DE",
 | 
				
			||||||
 | 
							title: "This Page",
 | 
				
			||||||
 | 
							href: "/potato",
 | 
				
			||||||
 | 
							description:
 | 
				
			||||||
 | 
							  "random text os iuoiu fsd ufiodsu foid sufo dsufois dufoisd eee sfsdffsdfsd sd sd ds dsfsv sd dss ds ds ufiosdufi osdufsdfsd iofusdoifudu siofsdfids ofudsiouoi",
 | 
				
			||||||
 | 
							image: "/temp.jpg",
 | 
				
			||||||
 | 
							imageAlt: "text",
 | 
				
			||||||
 | 
						  },
 | 
				
			||||||
 | 
						  {
 | 
				
			||||||
 | 
							value: "thatPage",
 | 
				
			||||||
 | 
							title: "That Page",
 | 
				
			||||||
 | 
							handle: "Projekt 2 DE",
 | 
				
			||||||
 | 
							href: "/potat2",
 | 
				
			||||||
 | 
							description: "random text",
 | 
				
			||||||
 | 
							image: "/temp.jpg",
 | 
				
			||||||
 | 
							imageAlt: "text",
 | 
				
			||||||
 | 
						  },
 | 
				
			||||||
 | 
						  {
 | 
				
			||||||
 | 
							value: "otherPage",
 | 
				
			||||||
 | 
							title: "Other Page",
 | 
				
			||||||
 | 
							handle: "Projekt 3 DE",
 | 
				
			||||||
 | 
							href: "/kartoffeln",
 | 
				
			||||||
 | 
							description: "random text",
 | 
				
			||||||
 | 
							image: "/temp.jpg",
 | 
				
			||||||
 | 
							imageAlt: "text",
 | 
				
			||||||
 | 
						  },
 | 
				
			||||||
 | 
						],
 | 
				
			||||||
  };
 | 
					  };
 | 
				
			||||||
 | 
					  
 | 
				
			||||||
@@ -1,3 +1,34 @@
 | 
				
			|||||||
export const en = {
 | 
					export const en = {
 | 
				
			||||||
	title: "EN Test",
 | 
						title: "EN Test",
 | 
				
			||||||
 | 
						showcase: [
 | 
				
			||||||
 | 
						  {
 | 
				
			||||||
 | 
							value: "thisPage",
 | 
				
			||||||
 | 
							handle: "Projekt 1 EN",
 | 
				
			||||||
 | 
							title: "This Page",
 | 
				
			||||||
 | 
							href: "/potato",
 | 
				
			||||||
 | 
							description:
 | 
				
			||||||
 | 
							  "random text os iuoiu fsd ufiodsu foid sufo dsufois dufoisd eee sfsdffsdfsd sd sd ds dsfsv sd dss ds ds ufiosdufi osdufsdfsd iofusdoifudu siofsdfids ofudsiouoi",
 | 
				
			||||||
 | 
							image: "/temp.jpg",
 | 
				
			||||||
 | 
							imageAlt: "text",
 | 
				
			||||||
 | 
						  },
 | 
				
			||||||
 | 
						  {
 | 
				
			||||||
 | 
							value: "thatPage",
 | 
				
			||||||
 | 
							title: "That Page",
 | 
				
			||||||
 | 
							handle: "Projekt 2 EN",
 | 
				
			||||||
 | 
							href: "/potat2",
 | 
				
			||||||
 | 
							description: "random text",
 | 
				
			||||||
 | 
							image: "/temp.jpg",
 | 
				
			||||||
 | 
							imageAlt: "text",
 | 
				
			||||||
 | 
						  },
 | 
				
			||||||
 | 
						  {
 | 
				
			||||||
 | 
							value: "otherPage",
 | 
				
			||||||
 | 
							title: "Other Page",
 | 
				
			||||||
 | 
							handle: "Projekt 3 EN",
 | 
				
			||||||
 | 
							href: "/kartoffeln",
 | 
				
			||||||
 | 
							description: "random text",
 | 
				
			||||||
 | 
							image: "/temp.jpg",
 | 
				
			||||||
 | 
							imageAlt: "text",
 | 
				
			||||||
 | 
						  },
 | 
				
			||||||
 | 
						],
 | 
				
			||||||
  };
 | 
					  };
 | 
				
			||||||
 | 
					  
 | 
				
			||||||
@@ -1,3 +1,34 @@
 | 
				
			|||||||
export const fr = {
 | 
					export const fr = {
 | 
				
			||||||
	title: "FR Test",
 | 
						title: "FR Test",
 | 
				
			||||||
 | 
						showcase: [
 | 
				
			||||||
 | 
						  {
 | 
				
			||||||
 | 
							value: "thisPage",
 | 
				
			||||||
 | 
							handle: "Projekt 1 FR",
 | 
				
			||||||
 | 
							title: "This Page",
 | 
				
			||||||
 | 
							href: "/potato",
 | 
				
			||||||
 | 
							description:
 | 
				
			||||||
 | 
							  "random text os iuoiu fsd ufiodsu foid sufo dsufois dufoisd eee sfsdffsdfsd sd sd ds dsfsv sd dss ds ds ufiosdufi osdufsdfsd iofusdoifudu siofsdfids ofudsiouoi",
 | 
				
			||||||
 | 
							image: "/temp.jpg",
 | 
				
			||||||
 | 
							imageAlt: "text",
 | 
				
			||||||
 | 
						  },
 | 
				
			||||||
 | 
						  {
 | 
				
			||||||
 | 
							value: "thatPage",
 | 
				
			||||||
 | 
							title: "That Page",
 | 
				
			||||||
 | 
							handle: "Projekt 2 FR",
 | 
				
			||||||
 | 
							href: "/potat2",
 | 
				
			||||||
 | 
							description: "random text",
 | 
				
			||||||
 | 
							image: "/temp.jpg",
 | 
				
			||||||
 | 
							imageAlt: "text",
 | 
				
			||||||
 | 
						  },
 | 
				
			||||||
 | 
						  {
 | 
				
			||||||
 | 
							value: "otherPage",
 | 
				
			||||||
 | 
							title: "Other Page",
 | 
				
			||||||
 | 
							handle: "Projekt 3 FR",
 | 
				
			||||||
 | 
							href: "/kartoffeln",
 | 
				
			||||||
 | 
							description: "random text",
 | 
				
			||||||
 | 
							image: "/temp.jpg",
 | 
				
			||||||
 | 
							imageAlt: "text",
 | 
				
			||||||
 | 
						  },
 | 
				
			||||||
 | 
						],
 | 
				
			||||||
  };
 | 
					  };
 | 
				
			||||||
 | 
					  
 | 
				
			||||||
		Reference in New Issue
	
	Block a user