File tree Expand file tree Collapse file tree 7 files changed +81
-6
lines changed 
modules/shared/components/navbar Expand file tree Collapse file tree 7 files changed +81
-6
lines changed Original file line number Diff line number Diff line change 1111  },
1212  "dependencies" : {
1313    "@stitches/react" : " ^1.2.8"  ,
14+     "i18next" : " ^25.3.6"  ,
1415    "react" : " ^19.1.0"  ,
1516    "react-dom" : " ^19.1.0"  ,
17+     "react-i18next" : " ^15.6.1"  ,
1618    "react-icons" : " ^5.5.0"  ,
1719    "react-router-dom" : " ^7.6.3" 
1820  },
Original file line number Diff line number Diff line change 1+ {
2+     "JoinUs" : {
3+         "title" : " Join Us" 
4+     },
5+     "Contact" : {
6+         "title" : " Contact Us" 
7+     },
8+     "FindOut" : {
9+         "title" : " Find Out" 
10+     },
11+     "MoreAboutUs" : {
12+         "title" : " More About Us" 
13+     },
14+     "WhyUs" : {
15+         "title" : " Why Us" 
16+     }
17+ }
Original file line number Diff line number Diff line change 1+ import  i18n  from  "i18next" ; 
2+ import  {  initReactI18next  }  from  "react-i18next" ; 
3+ 
4+ import  pl  from  './pl.json' 
5+ import  en  from  './en.json' 
6+ 
7+ const  DEFAULT_LANG  =  "en-US" ; 
8+ 
9+ const  userLang  =  navigator . language  ||  DEFAULT_LANG ; 
10+ const  resources  =  { 
11+   "pl-PL" : pl , 
12+   "en-US" : en , 
13+   "en-GB" : en , 
14+ } ; 
15+ 
16+ i18n 
17+   . use ( initReactI18next )  // passes i18n down to react-i18next 
18+   . init ( { 
19+     resources, 
20+     lng : userLang , 
21+     keySeparator : false , 
22+     nsSeparator : "." , 
23+     fallbackLng : DEFAULT_LANG , 
24+     cache : { 
25+         enabled : true , 
26+     } , 
27+     interpolation : { 
28+         escapeValue : false , 
29+     } , 
30+   } ) ; 
31+ 
32+   export  default  i18n ; 
Original file line number Diff line number Diff line change 1+ {
2+     "JoinUs" : {
3+         "title" : " Dołącz do nas" 
4+     },
5+     "Contact" : {
6+         "title" : " Zkontaktuj się" 
7+     },
8+     "FindOut" : {
9+         "title" : " Dowiedz się" 
10+     },
11+     "MoreAboutUs" : {
12+         "title" : " Więcej o nas" 
13+     },
14+     "WhyUs" : {
15+         "title" : " Dlaczego my" 
16+     }
17+ }
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import { StrictMode } from "react";
22import  {  createRoot  }  from  "react-dom/client" ; 
33import  App  from  "./App.tsx" ; 
44import  {  BrowserRouter  }  from  "react-router-dom" ; 
5+ import  "./i18n/i18n.js" ; 
56
67createRoot ( document . getElementById ( "root" ) ! ) . render ( 
78    < StrictMode > 
Original file line number Diff line number Diff line change @@ -13,10 +13,13 @@ import Button from "../button";
1313import  {  FaPhoneAlt  }  from  "react-icons/fa" ; 
1414import  {  IoMenu  }  from  "react-icons/io5" ; 
1515import  {  useState  }  from  "react" ; 
16+ import  {  useTranslation  }  from  "react-i18next" ; 
1617
1718const  Navbar  =  ( )  =>  { 
1819    const  [ isMenuOpen ,  setIsMenuOpen ]  =  useState < boolean > ( false ) ; 
1920
21+     const  { t}  =  useTranslation ( ) ; 
22+ 
2023    const  toggleMenu  =  ( ) : void   =>  { 
2124        setIsMenuOpen ( ! isMenuOpen ) ; 
2225    } ; 
@@ -32,13 +35,13 @@ const Navbar = () => {
3235                < StyledMenuList > 
3336                    < StyledMenuItem > 
3437                        < Link  className = "nav-link"  to = "/whyus" > 
35-                             Dlaczego my 
38+                             { t ( "WhyUs.title" ) } 
3639                        </ Link > 
3740                    </ StyledMenuItem > 
3841                    < StyledMenuItem > 
3942                        < Button  variant = "secondary"  fontSize = "16px" > 
4043                            < FaPhoneAlt  /> 
41-                             Kontakt 
44+                             { t ( "Contact.title" ) } 
4245                        </ Button > 
4346                    </ StyledMenuItem > 
4447                </ StyledMenuList > 
Original file line number Diff line number Diff line change @@ -6,8 +6,11 @@ import Navbar from "../../modules/shared/components/navbar";
66import  Box  from  "../../modules/shared/components/box" ; 
77import  Card  from  "../../modules/shared/components/card" ; 
88import  ImageWrapper  from  "./style" ; 
9+ import  {  useTranslation  }  from  "react-i18next" ; 
910
1011const  HeroScreen  =  ( )  =>  { 
12+     const  { t}  =  useTranslation ( ) ; 
13+ 
1114    return  ( 
1215        < > 
1316            < Layout > 
@@ -16,17 +19,17 @@ const HeroScreen = () => {
1619                    < Box  display = "flex"  gap = "20px"  margin = "20px" > 
1720                        < Button  variant = "primary" > 
1821                            < FaPhoneAlt  /> 
19-                             Dołącz do nas 
22+                             { t ( "JoinUs.title" ) } 
2023                        </ Button > 
2124                        < Button  variant = "secondary" > 
2225                            < FaPhoneAlt  /> 
23-                             Kontakt 
26+                             { t ( "Contact.title" ) } 
2427                        </ Button > 
2528                        < Button  variant = "outlined" > 
2629                            < IoIosInformationCircle  size = "1.8em"  /> 
2730                            < Box  display = "flex"  direction = "column" > 
28-                                 < span  style = { {  fontSize : "14px" ,  fontWeight : "normal"  } } > dowiedz się </ span > 
29-                                 < span > Więcej o nas </ span > 
31+                                 < span  style = { {  fontSize : "14px" ,  fontWeight : "normal"  } } > { t ( "FindOut.title" ) } </ span > 
32+                                 < span > { t ( "MoreAboutUs.title" ) } </ span > 
3033                            </ Box > 
3134                        </ Button > 
3235                    </ Box > 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments