Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

157 cross site i18n content required #158

Merged
merged 3 commits into from
Mar 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/[locale]/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export default function RootLayout({
params: {locale: string};
}) {
return (
<html lang="he" dir="rtl" suppressHydrationWarning={true}>
<html lang={locale} dir="rtl" suppressHydrationWarning={true}>
<body
className={`min-h-screen flex flex-col items-stretch m-0 darkmode-main ${birzia.className} ${inter.variable}`}
>
Expand Down
46 changes: 25 additions & 21 deletions app/[locale]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,33 @@ import Paths from '@/components/Paths/Paths';
import WhatNow from '@/components/Home/WhatNow';
import MembersPics from '@/components/MembersPics';

export const metadata = {
title: 'דף הבית | מעקף',
description:
'קהילת מעק"ף - מחפשי עבודה (תורמים) לקוד פתוח, היא קהילת קוד פתוח ישראלית, עבור כל מי שמתעניין בקוד פתוח - ממתחילים ועד מומחים. הצטרפו אלינו!',
openGraph: {
title: 'קהילת מעקף',
description:
'קהילת מעק"ף - מחפשי עבודה (תורמים) לקוד פתוח, היא קהילת קוד פתוח ישראלית, עבור כל מי שמתעניין בקוד פתוח - ממתחילים ועד מומחים. הצטרפו אלינו!',
url: 'https://maakaf-website.vercel.app/',
siteName: 'Maakaf',
type: 'website',
images: [
{
url: 'https://maakaf-website.vercel.app/favicon.ico',
width: 600,
height: 600,
},
],
},
};
import { getTranslations } from 'next-intl/server';

export default function Home() {
export async function generateMetadata() {
const t = await getTranslations('Metadata.HomePage');

return {
title: t('title'),
description: t('description'),
openGraph: {
title: 'קהילת מעקף',
description:
'קהילת מעק"ף - מחפשי עבודה (תורמים) לקוד פתוח, היא קהילת קוד פתוח ישראלית, עבור כל מי שמתעניין בקוד פתוח - ממתחילים ועד מומחים. הצטרפו אלינו!',
url: 'https://maakaf-website.vercel.app/',
siteName: 'Maakaf',
type: 'website',
images: [
{
url: 'https://maakaf-website.vercel.app/favicon.ico',
width: 600,
height: 600,
},
],
},
};
}

export default function Home() {
return (
<section className="mb-8">
<TitleSection />
Expand Down
2 changes: 1 addition & 1 deletion app/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {notFound} from 'next/navigation';
import {getRequestConfig} from 'next-intl/server';

// Can be imported from a shared config
const locales = ['en', 'he'];
const locales = ['he', 'en'];

export default getRequestConfig(async ({locale}) => {
// Validate that the incoming `locale` parameter is valid
Expand Down
5 changes: 4 additions & 1 deletion components/Home/TitleSection.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import DiscordLink from '@/components/Common/DiscordLink';
import { useTranslations } from 'next-intl';

export default function TitleSection() {
const t = useTranslations('TitleSection');

return (
<div className="relative mx-auto max-w-[1600px] px-4 flex justify-between h-[70vh] 2xl:h-[80vh] xl:h-[70vh] md:h-[70vh] md:px-14 pb-10 sm:h-[80vh]">
<div className="flex flex-col items-center w-full gap-6 mt-[1.2rem] 2xl:gap-12 lg:px-12 lg:mt-0 lg:gap-8 md:-mt-2 md:px-10 md:w-1/2 md:items-start md:gap-4">
<h1 className="w-full text-center 2xl:text-5xl xl:text-3xl lg:text-3xl md:text-right md:text-2xl">
קהילת מעקף&nbsp;-
{t('title')}&nbsp;-
<br />
קוד פתוח ישראל
</h1>
Expand Down
21 changes: 15 additions & 6 deletions public/locales/en.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
{
"about" : {
"welcome" : "Welcome to Maakaf",
"firstParagraph": "We believe in sharing information and knowledge as a way to promote technology and innovation. Open source is an approach that allows us to collaborate in software development openly and transparently.",
"secondParagraph": "When we talk about open source, we refer to software whose source code is available to the public for viewing, modification, and improvement. Open source gives us the opportunity to understand how software works, to enhance it, and to tailor it to our needs. We invite you to join us, to be impressed, to share, and to influence. Here in the Israeli open source community, there is a place for everyone, from beginners to experts.",
"thirdParagraph": "Join us"
"TitleSection": {
"title": "Maakaf Community"
},
"Metadata": {
"HomePage": {
"title": "Home page | Maakaf",
"description": "Maakaf is a community of open source developers"
}
}
},
"about": {
"welcome": "Welcome to Maakaf",
"firstParagraph": "We believe in sharing information and knowledge as a way to promote technology and innovation. Open source is an approach that allows us to collaborate in software development openly and transparently.",
"secondParagraph": "When we talk about open source, we refer to software whose source code is available to the public for viewing, modification, and improvement. Open source gives us the opportunity to understand how software works, to enhance it, and to tailor it to our needs. We invite you to join us, to be impressed, to share, and to influence. Here in the Israeli open source community, there is a place for everyone, from beginners to experts.",
"thirdParagraph": "Join us"
}
}
21 changes: 15 additions & 6 deletions public/locales/he.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
{
"about" : {
"welcome" : "ברוכים הבאים למעקף",
"firstParagraph": "אנו מאמינים בשיתוף המידע והידע כדרך לקידום הטכנולוגיה והחדשנות. קוד פתוח הוא גישה המאפשרת לנו לשתף פעולה בפיתוח תוכנה בצורה פתוחה ושקופה.",
"secondParagraph": "כשאנחנו מדברים על קוד פתוח, אנחנו מתייחסים לתוכנה שקוד המקור שלה זמין לציבור לצפייה, שינוי ושיפור. הקוד פתוח מעניק לנו הזדמנות להבין כיצד תוכנה פועלת, לשפר אותה ולהתאימה לצרכים שלנו. אנחנו מזמינים אתכם להצטרף אלינו, להתרשם, לשתף ולהשפיע. כאן בקהילת קוד פתוח ישראל יש מקום לכולם, מתחילים ועד מומחים",
"thirdParagraph": "יאללה בואו."
"TitleSection": {
"title": "קהילת מעקף"
},
"Metadata": {
"HomePage": {
"title": "דף בית | מעקף",
"description": "קהילת מעק\"ף - מחפשי עבודה (תורמים) לקוד פתוח, היא קהילת קוד פתוח ישראלית, עבור כל מי שמתעניין בקוד פתוח - ממתחילים ועד מומחים. הצטרפו אלינו!"
}
}
},
"about": {
"welcome": "ברוכים הבאים למעקף",
"firstParagraph": "אנו מאמינים בשיתוף המידע והידע כדרך לקידום הטכנולוגיה והחדשנות. קוד פתוח הוא גישה המאפשרת לנו לשתף פעולה בפיתוח תוכנה בצורה פתוחה ושקופה.",
"secondParagraph": "כשאנחנו מדברים על קוד פתוח, אנחנו מתייחסים לתוכנה שקוד המקור שלה זמין לציבור לצפייה, שינוי ושיפור. הקוד פתוח מעניק לנו הזדמנות להבין כיצד תוכנה פועלת, לשפר אותה ולהתאימה לצרכים שלנו. אנחנו מזמינים אתכם להצטרף אלינו, להתרשם, לשתף ולהשפיע. כאן בקהילת קוד פתוח ישראל יש מקום לכולם, מתחילים ועד מומחים",
"thirdParagraph": "יאללה בואו."
}
}
Loading