+ {t("contacts.captchaError") || "Please complete the captcha"}
+
+ )}
+
diff --git a/src/components/footer/footer.component.jsx b/src/components/footer/footer.component.jsx
index 2a1ead9..24a3a41 100644
--- a/src/components/footer/footer.component.jsx
+++ b/src/components/footer/footer.component.jsx
@@ -1,7 +1,9 @@
import React from "react";
+import { Link } from "gatsby";
import "./footer.style.scss";
import { useTranslation } from "react-i18next";
+import { getLocalizedPath } from "../../utils/navigation";
import Contacts from "../contacts/contacts.component";
import TopLine from "../../assets/images/main/footer/top-line.png";
@@ -27,21 +29,21 @@ const MidFooter = () => {
diff --git a/src/components/header/header.component.jsx b/src/components/header/header.component.jsx
index 970e998..f3f7d93 100644
--- a/src/components/header/header.component.jsx
+++ b/src/components/header/header.component.jsx
@@ -4,6 +4,7 @@ import { Link } from "gatsby";
import { useTranslation } from "react-i18next";
import LanguageSwitch from "../language-switch/language-switch.component";
+import { getLocalizedPath } from "../../utils/navigation";
import Logo from "../../assets/images/main/header/logo.svg";
import Logo2 from "../../assets/images/main/footer/logo.svg";
@@ -64,10 +65,10 @@ const MidHeader = () => {
@@ -91,11 +92,11 @@ const MidHeader = () => {
diff --git a/src/components/language-switch/language-switch.component.jsx b/src/components/language-switch/language-switch.component.jsx
index 67e1396..3698b37 100644
--- a/src/components/language-switch/language-switch.component.jsx
+++ b/src/components/language-switch/language-switch.component.jsx
@@ -1,4 +1,5 @@
import React from "react";
+import { navigate } from "gatsby";
import i18n from "../../i18n";
import "./language-switch.style.scss";
@@ -6,6 +7,13 @@ import "./language-switch.style.scss";
const LanguageSwitch = ({ t }) => {
const changeLanguage = (lng) => {
i18n.changeLanguage(lng);
+
+ // Navigate to the appropriate route
+ if (lng === "lv") {
+ navigate("/lv");
+ } else {
+ navigate("/");
+ }
};
return (
diff --git a/src/components/seo.jsx b/src/components/seo.jsx
index ca53945..16f6183 100644
--- a/src/components/seo.jsx
+++ b/src/components/seo.jsx
@@ -33,6 +33,10 @@ export const Seo = ({ title, description, pathname, children }) => {
gtag('config', 'G-8M9CZ79T4L');
`}
+
{children}
>
);
diff --git a/src/i18n.js b/src/i18n.js
index c01836a..c1ee12c 100644
--- a/src/i18n.js
+++ b/src/i18n.js
@@ -18,10 +18,13 @@ i18n
.use(initReactI18next) // passes i18n down to react-i18next
.init({
resources,
- lng: "en", // language to use, more information here: https://www.i18next.com/overview/configuration-options#languages-namespaces-resources
- // you can use the i18n.changeLanguage function to change the language manually: https://www.i18next.com/overview/api#changelanguage
- // if you're using a language detector, do not define the lng option
+ lng: typeof window !== "undefined" && window.location.pathname.startsWith("/lv") ? "lv" : "en", // Detect language from URL
fallbackLng: "en", // use en if detected lng is not available
+ detection: {
+ // Disable automatic detection to respect URL-based language
+ order: ["path", "localStorage", "navigator"],
+ caches: ["localStorage"],
+ },
interpolation: {
escapeValue: false, // react already safes from xss
diff --git a/src/pages/index.jsx b/src/pages/index.jsx
index 1ab3a0a..6fca1b3 100644
--- a/src/pages/index.jsx
+++ b/src/pages/index.jsx
@@ -1,11 +1,18 @@
import * as React from "react";
+import { useEffect } from "react";
import { Seo } from "../components/seo";
+import i18n from "../i18n";
import "../assets/stylesheets/style.scss";
import MidMainPage from "../main/main.component";
const IndexPage = () => {
+ useEffect(() => {
+ // Ensure English is set for the root route
+ i18n.changeLanguage("en");
+ }, []);
+
return ;
};
diff --git a/src/translations/en.json b/src/translations/en.json
index ec0bdc6..ec2a6ad 100644
--- a/src/translations/en.json
+++ b/src/translations/en.json
@@ -91,7 +91,8 @@
"phone": "phone",
"send": "Send",
"success": "Thank you for sharing your contacts! We will get in touch!",
- "error": "Looks like something went wrong, please try to reach us directly "
+ "error": "Looks like something went wrong, please try to reach us directly ",
+ "captchaError": "Please complete the captcha verification"
},
"privacy": {
"title": "Privacy Policy",
@@ -144,5 +145,27 @@
"registration_nr": "Registration nr.",
"address": "Address",
"navigation": "Navigation"
+ },
+ "landingPromo": {
+ "title": "Professional Landing Page Development in Just 2 Business Days – €150!",
+ "subtitle": "Looking to attract new customers quickly and effectively? Our experienced team specializes in creating efficient and modern landing pages that will help achieve your business goals.",
+ "whatYouGet": "What you get:",
+ "benefit1": "Customized landing page tailored to your brand and needs",
+ "benefit2": "Modern and user-friendly design",
+ "benefit3": "Mobile-responsive solution",
+ "benefit4": "Optimized page loading speed and SEO basics",
+ "benefit5": "Free consultation on content and structure creation",
+ "whyUs": "Why choose us:",
+ "feature1Title": "Fast Development",
+ "feature1": "Guaranteed delivery in just 2 business days",
+ "feature2Title": "Fixed Price",
+ "feature2": "€150 - no hidden costs",
+ "feature3Title": "Experienced Team",
+ "feature3": "Friendly and responsive team with website development experience",
+ "feature4Title": "Long-term Support",
+ "feature4": "Support even after page creation",
+ "ctaTitle": "Contact us today and get your new landing page in just two days!",
+ "ctaText": "Book a consultation – we'll help bring your ideas to life!",
+ "ctaButton": "Contact Us"
}
}
diff --git a/src/translations/lv.json b/src/translations/lv.json
index bd6e6b6..6b79339 100644
--- a/src/translations/lv.json
+++ b/src/translations/lv.json
@@ -91,12 +91,35 @@
"phone": "Telefons",
"send": "Nosūtīt",
"success": "Paldies ",
- "error": "Izskatās, ka kautkas nestrādā :( Uzrakstiet mums uz "
+ "error": "Izskatās, ka kautkas nestrādā :( Uzrakstiet mums uz ",
+ "captchaError": "Lūdzu, aizpildiet captcha verifikāciju"
},
"footer": {
"company": "Kompānija",
"registration_nr": "Reģistrācijas nr.",
"address": "Adrese",
"navigation": "Navigācija"
+ },
+ "landingPromo": {
+ "title": "Profesionāla landing lapu izstrāde tikai 2 darba dienu laikā – 150 €!",
+ "subtitle": "Vai vēlaties ātri un kvalitatīvi piesaistīt jaunus klientus? Mūsu pieredzējusī komanda specializējas efektīvu un modernu landing lapu izstrādē, kas palīdzēs sasniegt jūsu biznesa mērķus.",
+ "whatYouGet": "Ko jūs iegūstat:",
+ "benefit1": "Individuāli pielāgotu landing lapu atbilstoši jūsu zīmolam un vajadzībām",
+ "benefit2": "Mūsdienīgu un lietotājam draudzīgu dizainu",
+ "benefit3": "Mobilajām ierīcēm pielāgotu risinājumu",
+ "benefit4": "Optimizētu lapas ielādes ātrumu un SEO pamatus",
+ "benefit5": "Bezmaksas konsultāciju par satura un struktūras izveidi",
+ "whyUs": "Kāpēc izvēlēties mūs:",
+ "feature1Title": "Ātra izstrāde",
+ "feature1": "Garantēta izstrāde tikai 2 darba dienu laikā",
+ "feature2Title": "Fiksēta cena",
+ "feature2": "150 € - bez slēptām izmaksām",
+ "feature3Title": "Pieredzējuša komanda",
+ "feature3": "Draudzīga un atsaucīga komanda ar pieredzi mājaslapu izstrādē",
+ "feature4Title": "Ilgtermiņa atbalsts",
+ "feature4": "Atbalsts arī pēc lapas izveides",
+ "ctaTitle": "Sazinieties ar mums jau šodien un saņemiet savu jauno landing lapu tikai divu dienu laikā!",
+ "ctaText": "Piesakieties konsultācijai – mēs palīdzēsim īstenot jūsu idejas!",
+ "ctaButton": "Sazināties ar mums"
}
}