feat: implement internationalization support by updating locale files and adding language switch component

This commit is contained in:
2025-06-08 09:25:38 +03:30
parent 2ae57940f0
commit 12775285ec
19 changed files with 148 additions and 333 deletions
-63
View File
@@ -1,63 +0,0 @@
// This file is auto-generated by next-intl, do not edit directly.
// See: https://next-intl.dev/docs/workflows/typescript#messages-arguments
declare const messages: {
"pages_home_title": "Home",
"pages_home_description": "Welcome to the home page",
"pages_about_title": "About Us",
"pages_about_description": "Learn more about us on this page",
"pages_contact_title": "Contact Us",
"pages_product_categories_title": "Products",
"pages_products_title": "Products",
"pages_blog_title": "Blog",
"pages_projects_title": "Projects",
"pages_contact_description": "Get in touch with us through this page",
"com_home_banner_title": "Excellence innovating",
"com_home_banner_title_bold": "industry for today",
"com_home_banner_description": "At the heart of our operations is a commitment to delivering superior products through cutting- <br/> edge technology and innovative processes.",
"com_home_banner_button": " Explore More",
"com_home_Banner_link1": " Advanced Manufacturing Solutions",
"com_home_Banner_link2": "Quality Assurance Systems",
"com_home_Banner_link3": "State-of-the-Art Technology",
"com_about_info_title": "Building quality through",
"com_about_info_title_bold": "industrial innovation",
"com_about_info_description": "At the heart of our operations is a commitment to delivering superior products through cutting-edge technology and innovative processes.",
"com_about_info_years_experience": "years of experience",
"com_about_info_achievements_1": "Sustainable Manufacturing",
"com_about_info_achievements_2": "Advanced Automation",
"com_about_info_achievements_3": "Efficient Production Processes",
"com_about_info_achievements_4": "Reliable Delivery Services",
"com_home_products_title": "The Qualified bricks for Your Projects",
"com_home_products_description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.",
"footer_title": "Industrial Solutions for a Modern World",
"footer_description": "We are committed to providing personalized industrial solutions that meet the unique needs of our clients. Our team of experts is dedicated to delivering high-quality products and services that drive success in todays competitive market.",
"footer_slogan": "We are committed to providing personalized industrial solutions.",
"footer_links_quick_links": "Quick Links",
"footer_links_who_we_are": "Who We Are",
"footer_links_contact": "Contact",
"footer_copyright": "Copyright © 2025 All Rights Reserved.",
"footer_links_address": "123 Industrial Ave, Suite 456, City, Country",
"com_home_story_title": "Our Story",
"com_home_story_slogan": "Building quality through",
"com_home_story_slogan_bold": "industrial innovation",
"com_home_story_description": "We are a leading provider of industrial solutions, dedicated to delivering high-quality products and services that meet the unique needs of our clients. Our team of experts is committed to driving success in todays competitive market through innovation and excellence.",
"com_home_story_projects_count": "Completed Projects",
"com_home_story_customer_count": "Happy Customers",
"com_home_story_experience": "Years of Experience",
"com_products_category_Ghazaghi_title": "Ghazaghi",
"com_products_category_Ghermez_title": "Ghermez",
"com_products_category_Semirom_title": "Semirom",
"com_products_category_Zard_title": "Zard",
"com_products_category_types_count": "count Types",
"com_products_category_show_all_CTA": "Show Products",
"pages_products_content_title": "Brick Classification: Understanding the Variety and Applications",
"pages_products_content_description": "Bricks, as one of humanity's oldest and most widely used building materials, have evolved significantly throughout history. Today, they are produced and supplied in an incredibly diverse range, allowing engineers and architects to choose the most suitable brick for any project and need, from traditional and historic structures to modern and advanced buildings. To better understand this diversity, we can classify bricks based on several key criteria, each with its own specific characteristics and applications. \n 1. Classification by Manufacturing Method: From Tradition to Advanced IndustryThe method by which bricks are produced directly impacts their appearance, texture, and properties. Hand-moulded/Stock Bricks: These bricks are produced by manually pressing clay into molds. The result is a brick with a relatively rough texture, uneven edges, and a more traditional appearance, where each piece feels unique. This type of brick is often used for restoration projects or for constructing buildings with a rustic or antique style. Machine-made Bricks: These bricks are produced using industrial machinery, resulting in much higher precision in dimensions and uniformity in appearance. Machine-made bricks themselves are divided into two main categories: Perforated/Hollow Bricks: These bricks have holes, offering several advantages: they reduce building weight, improve thermal and acoustic insulation, and enhance mortar adhesion. Solid Bricks: These bricks are without holes and possess very high compressive strength. They are ideal for load-bearing structures and walls requiring maximum strength. 2. Classification by Raw Material Type and Composition: From Clay to Concrete The material from which a brick is made determines its physical and chemical properties.",
"com_products_products_category_title": "Products of {title} Category"
};
export default messages;
+51 -51
View File
@@ -1,59 +1,59 @@
{
"pages_home_title": "Home",
"pages_home_description": "Welcome to the home page",
"pages_about_title": "About Us",
"pages_about_description": "Learn more about us on this page",
"pages_contact_title": "Contact Us",
"pages_product_categories_title": "Products",
"pages_products_title": "Products",
"pages_blog_title": "Blog",
"pages_projects_title": "Projects",
"pages_contact_description": "Get in touch with us through this page",
"com_home_banner_title": "Excellence innovating",
"com_home_banner_title_bold": "industry for today",
"com_home_banner_description": "At the heart of our operations is a commitment to delivering superior products through cutting- <br/> edge technology and innovative processes.",
"com_home_banner_button": " Explore More",
"com_home_Banner_link1": " Advanced Manufacturing Solutions",
"com_home_Banner_link2": "Quality Assurance Systems",
"com_home_Banner_link3": "State-of-the-Art Technology",
"pages_home_title": "خانه",
"pages_home_description": "به صفحه اصلی خوش آمدید",
"pages_about_title": "درباره ما",
"pages_about_description": "در این صفحه بیشتر درباره ما بدانید",
"pages_contact_title": "تماس با ما",
"pages_product_categories_title": "محصولات",
"pages_products_title": "محصولات",
"pages_blog_title": "وبلاگ",
"pages_projects_title": "پروژه‌ها",
"pages_contact_description": "از طریق این صفحه با ما در تماس باشید",
"com_home_banner_title": "نوآوری در تعالی",
"com_home_banner_title_bold": "صنعت برای امروز",
"com_home_banner_description": "در قلب فعالیت‌های ما تعهد به ارائه محصولات برتر از طریق فناوری پیشرفته و فرآیندهای نوآورانه قرار دارد.",
"com_home_banner_button": "بیشتر بدانید",
"com_home_Banner_link1": "راهکارهای پیشرفته تولید",
"com_home_Banner_link2": "سیستم‌های تضمین کیفیت",
"com_home_Banner_link3": "فناوری روز دنیا",
"com_about_info_title": "Building quality through",
"com_about_info_title_bold": "industrial innovation",
"com_about_info_description": "At the heart of our operations is a commitment to delivering superior products through cutting-edge technology and innovative processes.",
"com_about_info_years_experience": "years of experience",
"com_about_info_achievements_1": "Sustainable Manufacturing",
"com_about_info_achievements_2": "Advanced Automation",
"com_about_info_achievements_3": "Efficient Production Processes",
"com_about_info_achievements_4": "Reliable Delivery Services",
"com_about_info_title": "ساخت کیفیت از طریق",
"com_about_info_title_bold": "نوآوری صنعتی",
"com_about_info_description": "در قلب فعالیت‌های ما تعهد به ارائه محصولات برتر از طریق فناوری پیشرفته و فرآیندهای نوآورانه قرار دارد.",
"com_about_info_years_experience": "سال تجربه",
"com_about_info_achievements_1": "تولید پایدار",
"com_about_info_achievements_2": "اتوماسیون پیشرفته",
"com_about_info_achievements_3": "فرآیندهای تولید کارآمد",
"com_about_info_achievements_4": "خدمات تحویل قابل اعتماد",
"com_home_products_title": "The Qualified bricks for Your Projects",
"com_home_products_description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.",
"com_home_products_title": "آجرهای با کیفیت برای پروژه‌های شما",
"com_home_products_description": "لورم ایپسوم متن ساختگی با تولید سادگی نامفهوم از صنعت چاپ و با استفاده از طراحان گرافیک است.",
"footer_title": "Industrial Solutions for a Modern World",
"footer_description": "We are committed to providing personalized industrial solutions that meet the unique needs of our clients. Our team of experts is dedicated to delivering high-quality products and services that drive success in todays competitive market.",
"footer_slogan": "We are committed to providing personalized industrial solutions.",
"footer_links_quick_links": "Quick Links",
"footer_links_who_we_are": "Who We Are",
"footer_links_contact": "Contact",
"footer_copyright": "Copyright © 2025 All Rights Reserved.",
"footer_links_address": "123 Industrial Ave, Suite 456, City, Country",
"footer_title": "راهکارهای صنعتی برای دنیای مدرن",
"footer_description": "ما متعهد به ارائه راهکارهای صنعتی شخصی‌سازی شده هستیم که نیازهای منحصر به فرد مشتریانمان را برآورده می‌کند. تیم متخصص ما به ارائه محصولات و خدمات با کیفیت بالا که موفقیت را در بازار رقابتی امروز تضمین می‌کند، متعهد است.",
"footer_slogan": "ما متعهد به ارائه راهکارهای صنعتی شخصی‌سازی شده هستیم.",
"footer_links_quick_links": "لینک‌های سریع",
"footer_links_who_we_are": "ما که هستیم",
"footer_links_contact": "تماس",
"footer_copyright": "کلیه حقوق محفوظ است © ۲۰۲۵",
"footer_links_address": "خیابان صنعتی ۱۲۳، واحد ۴۵۶، شهر، کشور",
"com_home_story_title": "Our Story",
"com_home_story_slogan": "Building quality through",
"com_home_story_slogan_bold": "industrial innovation",
"com_home_story_description": "We are a leading provider of industrial solutions, dedicated to delivering high-quality products and services that meet the unique needs of our clients. Our team of experts is committed to driving success in todays competitive market through innovation and excellence.",
"com_home_story_projects_count": "Completed Projects",
"com_home_story_customer_count": "Happy Customers",
"com_home_story_experience": "Years of Experience",
"com_home_story_title": "داستان ما",
"com_home_story_slogan": "ساخت کیفیت از طریق",
"com_home_story_slogan_bold": "نوآوری صنعتی",
"com_home_story_description": "ما ارائه‌دهنده پیشرو راهکارهای صنعتی هستیم که به ارائه محصولات و خدمات با کیفیت بالا متعهدیم تا نیازهای منحصر به فرد مشتریانمان را برآورده کنیم. تیم متخصص ما با نوآوری و تعالی، موفقیت را در بازار رقابتی امروز تضمین می‌کند.",
"com_home_story_projects_count": "پروژه‌های انجام شده",
"com_home_story_customer_count": "مشتریان راضی",
"com_home_story_experience": "سال تجربه",
"com_products_category_Ghazaghi_title": "Ghazaghi",
"com_products_category_Ghermez_title": "Ghermez",
"com_products_category_Semirom_title": "Semirom",
"com_products_category_Zard_title": "Zard",
"com_products_category_types_count": "count Types",
"com_products_category_show_all_CTA": "Show Products",
"pages_products_content_title": "Brick Classification: Understanding the Variety and Applications",
"pages_products_content_description": "Bricks, as one of humanity's oldest and most widely used building materials, have evolved significantly throughout history. Today, they are produced and supplied in an incredibly diverse range, allowing engineers and architects to choose the most suitable brick for any project and need, from traditional and historic structures to modern and advanced buildings. To better understand this diversity, we can classify bricks based on several key criteria, each with its own specific characteristics and applications. \n 1. Classification by Manufacturing Method: From Tradition to Advanced IndustryThe method by which bricks are produced directly impacts their appearance, texture, and properties. Hand-moulded/Stock Bricks: These bricks are produced by manually pressing clay into molds. The result is a brick with a relatively rough texture, uneven edges, and a more traditional appearance, where each piece feels unique. This type of brick is often used for restoration projects or for constructing buildings with a rustic or antique style. Machine-made Bricks: These bricks are produced using industrial machinery, resulting in much higher precision in dimensions and uniformity in appearance. Machine-made bricks themselves are divided into two main categories: Perforated/Hollow Bricks: These bricks have holes, offering several advantages: they reduce building weight, improve thermal and acoustic insulation, and enhance mortar adhesion. Solid Bricks: These bricks are without holes and possess very high compressive strength. They are ideal for load-bearing structures and walls requiring maximum strength. 2. Classification by Raw Material Type and Composition: From Clay to Concrete The material from which a brick is made determines its physical and chemical properties.",
"com_products_category_Ghazaghi_title": "غذاقی",
"com_products_category_Ghermez_title": "قرمز",
"com_products_category_Semirom_title": "سمیرم",
"com_products_category_Zard_title": "زرد",
"com_products_category_types_count": "تعداد نوع",
"com_products_category_show_all_CTA": "نمایش محصولات",
"pages_products_content_title": "طبقه‌بندی آجر: درک تنوع و کاربردها",
"pages_products_content_description": "آجرها به عنوان یکی از قدیمی‌ترین و پرکاربردترین مصالح ساختمانی بشر، در طول تاریخ دچار تحول زیادی شده‌اند. امروزه این مصالح در طیف بسیار متنوعی تولید و عرضه می‌شوند و به مهندسان و معماران این امکان را می‌دهند تا مناسب‌ترین آجر را برای هر پروژه و نیازی، از سازه‌های سنتی و تاریخی تا ساختمان‌های مدرن و پیشرفته، انتخاب کنند. برای درک بهتر این تنوع، می‌توان آجرها را بر اساس چند معیار کلیدی طبقه‌بندی کرد که هر یک ویژگی‌ها و کاربردهای خاص خود را دارند.\n۱. طبقه‌بندی بر اساس روش تولید: از سنت تا صنعت پیشرفته\nروش تولید آجرها مستقیماً بر ظاهر، بافت و ویژگی‌های آن‌ها تأثیر می‌گذارد.\nآجرهای دستی/قالبی: این آجرها با فشار دادن دستی خاک رس در قالب تولید می‌شوند. نتیجه، آجری با بافت نسبتاً زبر، لبه‌های نامنظم و ظاهری سنتی‌تر است که هر قطعه حس منحصر به فردی دارد. این نوع آجر اغلب برای پروژه‌های مرمت یا ساخت ساختمان‌هایی با سبک روستایی یا قدیمی استفاده می‌شود.\nآجرهای ماشینی: این آجرها با استفاده از ماشین‌آلات صنعتی تولید می‌شوند که دقت ابعادی و یکنواختی ظاهری بسیار بالاتری دارند. آجرهای ماشینی خود به دو دسته اصلی تقسیم می‌شوند:\nآجرهای سوراخ‌دار/توخالی: این آجرها دارای سوراخ‌هایی هستند که چندین مزیت دارند: کاهش وزن ساختمان، بهبود عایق حرارتی و صوتی و افزایش چسبندگی ملات.\nآجرهای توپر: این آجرها بدون سوراخ بوده و مقاومت فشاری بسیار بالایی دارند. آن‌ها برای سازه‌های باربر و دیوارهایی که به حداکثر استحکام نیاز دارند، ایده‌آل هستند.\n۲. طبقه‌بندی بر اساس نوع و ترکیب مواد اولیه: از خاک رس تا بتن\nجنس آجر تعیین‌کننده ویژگی‌های فیزیکی و شیمیایی آن است.",
"com_products_products_category_title": "Products of {title} Category"
"com_products_products_category_title": "محصولات دسته {title}"
}
+16
View File
@@ -19,6 +19,7 @@
"devDependencies": {
"@eslint/eslintrc": "^3",
"@tailwindcss/postcss": "^4",
"@types/leaflet": "^1.9.18",
"@types/node": "^20",
"@types/react": "^19",
"@types/react-dom": "^19",
@@ -1289,6 +1290,12 @@
"integrity": "sha512-w28IoSUCJpidD/TGviZwwMJckNESJZXFu7NBZ5YJ4mEUnNraUn9Pm8HSZm/jDF1pDWYKspWE7oVphigUPRakIQ==",
"dev": true
},
"node_modules/@types/geojson": {
"version": "7946.0.16",
"resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-7946.0.16.tgz",
"integrity": "sha512-6C8nqWur3j98U6+lXDfTUWIfgvZU+EumvpHKcYjujKH7woYyLj2sUmff0tRhrqM7BohUw7Pz3ZB1jj2gW9Fvmg==",
"dev": true
},
"node_modules/@types/json-schema": {
"version": "7.0.15",
"resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz",
@@ -1301,6 +1308,15 @@
"integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==",
"dev": true
},
"node_modules/@types/leaflet": {
"version": "1.9.18",
"resolved": "https://registry.npmjs.org/@types/leaflet/-/leaflet-1.9.18.tgz",
"integrity": "sha512-ht2vsoPjezor5Pmzi5hdsA7F++v5UGq9OlUduWHmMZiuQGIpJ2WS5+Gg9HaAA79gNh1AIPtCqhzejcIZ3lPzXQ==",
"dev": true,
"dependencies": {
"@types/geojson": "*"
}
},
"node_modules/@types/node": {
"version": "20.17.57",
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.17.57.tgz",
+1
View File
@@ -20,6 +20,7 @@
"devDependencies": {
"@eslint/eslintrc": "^3",
"@tailwindcss/postcss": "^4",
"@types/leaflet": "^1.9.18",
"@types/node": "^20",
"@types/react": "^19",
"@types/react-dom": "^19",
+35
View File
@@ -0,0 +1,35 @@
import '@/app/globals.css';
import { notFound } from 'next/navigation';
import { NextIntlClientProvider } from 'next-intl';
import type { ILayoutLocaleParams } from '@/models/layout.d';
// export const metadata: Metadata = {
// title: 'Create Next App',
// description: 'Generated by create next app',
// };
export default async function RootLayout({
children,
params,
}: Readonly<{
children: React.ReactNode;
params: ILayoutLocaleParams;
}>) {
const locale = params.locale;
let messages;
try {
messages = (await import(`../../../messages/${locale}.json`)).default;
} catch (error) {
notFound();
}
return (
<html lang={locale} dir={locale === 'fa' ? 'rtl' : 'ltr'}>
<body className="min-h-svh w-full overflow-x-hidden">
<NextIntlClientProvider locale={locale} messages={messages}>
{children}
</NextIntlClientProvider>
</body>
</html>
);
}
+1 -1
View File
@@ -13,7 +13,7 @@ export default async function NotFound({
const routes = routeFactory(t, params.locale);
return (
<div className="container mx-auto my-32 flex flex-col items-center justify-center gap-6">
<div className="container mx-auto flex h-svh flex-col items-center justify-center gap-6">
<h2 className="text-center text-4xl md:text-[5rem]">
{t('pages_notFound_title')}
</h2>
+3 -5
View File
@@ -18,15 +18,13 @@ export default async function RootLayout({
params: ILayoutLocaleParams;
}>) {
const locale = params.locale;
console.log(locale);
let messages;
try {
console.log(await import(`../../../messages/en.json`));
messages = (await import(`../../../messages/en.json`)).default;
messages = (await import(`../../../messages/${locale}.json`)).default;
console.log('locale');
console.log(locale);
} catch (error) {
console.log(error);
notFound();
}
+1 -1
View File
@@ -5,7 +5,7 @@ import { useParams } from 'next/navigation';
import { getQuickLinks } from '@/assets/constants/footerMenu/quickLinks.const';
import { getWhoAreWeLinks } from './whoAreWe.const';
import { TLocales } from '@/locales/translates';
import { TLocales } from '@/models/layout';
export default function FooterMenu() {
const t = useTranslations();
@@ -1,7 +1,8 @@
import routeFactory from '../routeFactory';
export function getQuickLinks(t: (key: string) => string, locale: string) {
export function getQuickLinks(t: any, locale: string) {
const routes = routeFactory(t, locale);
return [
{
title: routes.home.title,
@@ -1,6 +1,6 @@
import routeFactory from '../routeFactory';
export function getWhoAreWeLinks(t: (key: string) => string, locale: string) {
export function getWhoAreWeLinks(t: any, locale: string) {
const routes = routeFactory(t, locale);
return [
{
+2 -2
View File
@@ -10,12 +10,12 @@ import { useTranslations } from 'next-intl';
import { useParams } from 'next/navigation';
import { getQuickLinks } from '@/assets/constants/footerMenu/quickLinks.const';
import { getWhoAreWeLinks } from '@/assets/constants/footerMenu/whoAreWe.const';
import { TLocales } from '@/locales/translates';
import { TLocales } from '@/models/layout';
export default function Footer() {
const t = useTranslations();
const params = useParams();
const locale = params.locale as TLocales;
const locale = (params.locale as TLocales) || 'en';
const quickLinks = getQuickLinks(t, locale);
const whoAreWeLinks = getWhoAreWeLinks(t, locale);
@@ -6,6 +6,7 @@ import { Icon, IconName } from '@/components/uikit/icons';
import Image from 'next/image';
import Link from 'next/link';
import { useTranslations } from 'next-intl';
import LanguageSwitch from '../languageSwitch';
export default function FooterInfo({
withLogo,
@@ -42,6 +43,7 @@ export default function FooterInfo({
</Link>
))}
</div>
<LanguageSwitch />
</div>
);
}
@@ -0,0 +1,28 @@
'use client';
import Link from 'next/link';
import { usePathname } from 'next/navigation';
export default function LanguageSwitch() {
const pathname = usePathname();
const pathWithoutLocale = pathname.replace(/^\/(en|fa)/, '');
return (
<div className="flex items-center justify-center">
<Link
href={`/en${pathWithoutLocale === '/' ? '' : pathWithoutLocale}`}
className="mx-2 text-gray-800 hover:text-blue-500"
>
EN
</Link>
<span className="text-gray-800">|</span>
<Link
href={`/fa${pathWithoutLocale === '/' ? '' : pathWithoutLocale}`}
className="mx-2 text-gray-800 hover:text-blue-500"
>
FA
</Link>
</div>
);
}
+2 -1
View File
@@ -3,6 +3,7 @@
import { MapContainer, TileLayer, Marker, Popup } from 'react-leaflet';
import L from 'leaflet';
import 'leaflet/dist/leaflet.css';
import 'leaflet/dist/leaflet.css';
delete (L.Icon.Default.prototype as any)._getIconUrl;
L.Icon.Default.mergeOptions({
@@ -30,7 +31,7 @@ const ContactMap = () => {
url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
/>
<Marker position={position}>
<Popup>lastminute.com London Eye</Popup>
<Popup>Pasargad Bricks</Popup>
</Marker>
</MapContainer>
</div>
+1 -1
View File
@@ -6,7 +6,7 @@ import Link from 'next/link';
import routeFactory from '@/assets/constants/routeFactory';
import { getTranslations } from 'next-intl/server';
import { ILayoutLocaleParams } from '@/models/layout';
import { TLocales } from '@/locales/translates';
import { TLocales } from '@/models/layout';
interface Props {
locale: TLocales;
-97
View File
@@ -1,97 +0,0 @@
const en = {
pages_home_title: 'Home',
pages_home_description: 'Welcome to the home page',
pages_about_title: 'About Us',
pages_about_description: 'Learn more about us on this page',
pages_notFound_title: '404 Not Found Page',
pages_notFound_description: 'You can either head back to the Homepage or try a search.',
pages_notFound_button:"Go To Home",
pages_contact_title: 'Contact Us',
pages_product_categories_title: 'Products',
pages_products_title: 'Products',
pages_blog_title: 'Blog',
pages_projects_title: 'Projects',
pages_contact_description: 'Get in touch with us through this page',
com_home_banner_title: 'Excellence innovating',
com_home_banner_title_bold: 'industry for today',
com_home_banner_description:
'At the heart of our operations is a commitment to delivering superior products through cutting- <br/> edge technology and innovative processes. ',
com_home_banner_button: ' Explore More',
com_home_Banner_link1: ' Advanced Manufacturing Solutions',
com_home_Banner_link2: 'Quality Assurance Systems',
com_home_Banner_link3: 'State-of-the-Art Technology',
com_about_info_title: 'Building quality through',
com_about_info_title_bold: 'industrial innovation',
com_about_info_description:
'At the heart of our operations is a commitment to delivering superior products through cutting-edge technology and innovative processes.',
com_about_info_years_experience: 'years of experience',
com_about_info_achievements_1: 'Sustainable Manufacturing',
com_about_info_achievements_2: 'Advanced Automation',
com_about_info_achievements_3: 'Efficient Production Processes',
com_about_info_achievements_4: 'Reliable Delivery Services',
com_home_products_title: 'The Qualified bricks for Your Projects',
com_home_products_description:
'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. ',
com_contact_touch_title: 'Get in touch',
com_contact_touch_title_bold: 'with us',
com_contact_touch_description: 'Reach out for any inquiries, support, or to discuss how we can meet your industrial needs.',
com_contact_touch_option_1:'Contact',
com_contact_touch_option_2:'E-mail',
com_contact_touch_option_3:'Our Address',
com_contact_touch_option_3_description:'37 San Juan Lane Graaf Florisstraat 22A,3021 CH',
com_contact_title: 'Contact ',
com_contact_title_bold: 'me',
com_contact_first_name: 'Enter first name',
com_contact_last_name: 'Enter last name',
com_contact_email: 'Enter your e-mail',
com_contact_phone: 'Enter your phone no.',
com_contact_textarea: 'Write Message',
footer_title: 'Industrial Solutions for a Modern World',
footer_description:
'We are committed to providing personalized industrial solutions that meet the unique needs of our clients. Our team of experts is dedicated to delivering high-quality products and services that drive success in todays competitive market.',
footer_slogan:
'We are committed to providing personalized industrial solutions.',
footer_links_quick_links: 'Quick Links',
footer_links_who_we_are: 'Who We Are',
footer_links_contact: 'Contact',
footer_copyright: 'Copyright © 2025 All Rights Reserved.',
footer_links_address: '123 Industrial Ave, Suite 456, City, Country',
// Home Page Components
com_home_story_title: 'Our Story',
com_home_story_slogan: 'Building quality through',
com_home_story_slogan_bold: 'industrial innovation',
com_home_story_description:
'We are a leading provider of industrial solutions, dedicated to delivering high-quality products and services that meet the unique needs of our clients. Our team of experts is committed to driving success in todays competitive market through innovation and excellence.',
com_home_story_projects_count: 'Completed Projects',
com_home_story_customer_count: 'Happy Customers',
com_home_story_experience: 'Years of Experience',
// Products Page Components
com_products_category_Ghazaghi_title: 'Ghazaghi',
com_products_category_Ghermez_title: 'Ghermez',
com_products_category_Semirom_title: 'Semirom',
com_products_category_Zard_title: 'Zard',
com_products_category_types_count: ({ count }: { count: number }) =>
`${count} Types`,
com_products_category_show_all_CTA: 'Show Products',
pages_products_content_title:
'Brick Classification: Understanding the Variety and Applications',
pages_products_content_description: `Bricks, as one of humanity's oldest and most widely used building materials, have evolved significantly throughout history. Today, they are produced and supplied in an incredibly diverse range, allowing engineers and architects to choose the most suitable brick for any project and need, from traditional and historic structures to modern and advanced buildings. To better understand this diversity, we can classify bricks based on several key criteria, each with its own specific characteristics and applications.
\n 1. Classification by Manufacturing Method: From Tradition to Advanced Industry
The method by which bricks are produced directly impacts their appearance, texture, and properties.
Hand-moulded/Stock Bricks: These bricks are produced by manually pressing clay into molds. The result is a brick with a relatively rough texture, uneven edges, and a more traditional appearance, where each piece feels unique. This type of brick is often used for restoration projects or for constructing buildings with a rustic or antique style.
Machine-made Bricks: These bricks are produced using industrial machinery, resulting in much higher precision in dimensions and uniformity in appearance. Machine-made bricks themselves are divided into two main categories:
Perforated/Hollow Bricks: These bricks have holes, offering several advantages: they reduce building weight, improve thermal and acoustic insulation, and enhance mortar adhesion.
Solid Bricks: These bricks are without holes and possess very high compressive strength. They are ideal for load-bearing structures and walls requiring maximum strength.
2. Classification by Raw Material Type and Composition: From Clay to Concrete
The material from which a brick is made determines its physical and chemical properties.`,
com_products_products_category_title: ({ title }: { title: string }) =>
`Products of ${title} Category`,
};
export default en;
-40
View File
@@ -1,40 +0,0 @@
import { Translates } from './translates';
const fa = {
pages_home_title: 'صفحه‌ی اصلی',
pages_home_description: 'Welcome to the home page',
pages_about_title: 'About Us',
pages_about_description: 'Learn more about us on this page',
pages_notFound_title: '404 Not Found Page',
pages_notFound_description: 'You can either head back to the Homepage or try a search.',
pages_notFound_button:"Go To Home",
pages_contact_title: 'Contact Us',
pages_product_categories_title: 'Product',
pages_blog_title: 'Blog',
pages_projects_title: 'Project',
pages_contact_description: 'Get in touch with us through this page',
com_home_banner_title: 'Excellence innovating',
com_home_banner_title_bold: 'industry for today',
com_home_banner_description:
'At the heart of our operations is a commitment to delivering superior products through cutting- <br/> edge technology and innovative processes. ',
com_home_banner_button: 'اطلاعات بیشتر',
com_home_Banner_link1: ' Advanced Manufacturing Solutions',
com_home_Banner_link2: 'Quality Assurance Systems',
com_home_Banner_link3: 'State-of-the-Art Technology',
com_contact_touch_title: 'Get in touch',
com_contact_touch_title_bold: 'with us',
com_contact_touch_description: 'Reach out for any inquiries, support, or to discuss how we can meet your industrial needs.',
com_contact_touch_option_1:'Contact',
com_contact_touch_option_2:'E-mail',
com_contact_touch_option_3:'Our Address',
com_contact_touch_option_3_description:'37 San Juan Lane Graaf Florisstraat 22A,3021 CH',
com_contact_title: 'Contact ',
com_contact_title_bold: 'me',
com_contact_first_name: 'Enter first name',
com_contact_last_name: 'Enter last name',
com_contact_email: 'Enter your e-mail',
com_contact_phone: 'Enter your phone no.',
com_contact_textarea: 'Write Message',
} as Translates;
export default fa;
-69
View File
@@ -1,69 +0,0 @@
import en from './en';
import fa from './fa';
// Universal getCookie function
export function getCookie(name: string): string | undefined {
if (typeof window !== 'undefined') {
// Client-side
const match = document.cookie.match(
new RegExp('(^| )' + name + '=([^;]+)'),
);
return match ? decodeURIComponent(match[2]) : undefined;
} else {
// Server-side (Next.js App Router)
try {
// Dynamically import to avoid errors in client bundle
const { cookies } = require('next/headers');
return cookies().get(name)?.value;
} catch {
return undefined;
}
}
}
// Universal setCookie function to change language
export function changeLanguage(lang: TLocales, days = 365) {
if (typeof window !== 'undefined') {
// Client-side
const expires = new Date(Date.now() + days * 864e5).toUTCString();
document.cookie = `lang=${encodeURIComponent(lang)}; expires=${expires}; path=/`;
} else {
// Server-side (Next.js App Router)
try {
const { cookies } = require('next/headers');
cookies().set('lang', lang, { path: '/', maxAge: days * 24 * 60 * 60 });
} catch {
// No-op on server if not available
}
}
}
export const locales = {
en: en as unknown as Translates,
fa,
} as Record<TLocales, Translates>;
export const translates = (
key: keyof Translates,
dynamicValue?: Record<string, string | number>,
): string | ((dynamicValue: Record<string, string | number>) => string) => {
const lang = (getCookie('lang') || 'en') as TLocales;
const value = locales[lang][key] || locales.en[key] || key;
if (typeof value === 'function') {
return value(dynamicValue || {});
}
return value;
};
export const t = (
key: keyof Translates,
dynamicValue?: Record<string, string | number>,
) => '';
export type TLocales = 'en' | 'fa';
export type Translates = {
[K in keyof typeof en]:
| string
| ((dynamicValue: Record<string, string | number>) => string);
};
+2
View File
@@ -1,3 +1,5 @@
export interface ILayoutLocaleParams {
locale: TLocales;
}
export type TLocales = 'en' | 'fa';